// gameballworld.h  A side-scroller game.
//
//////////////////////////////////////////////////////////////////////

#ifndef GAMEBALLWORLD_H
#define GAMEBALLWORLD_H

#include "game.h"
#include "critterarmed.h"

//==============Critters for the cGameBallworld: Player, Ball, Treasure ================

class cCritterBallworldPlayer : public cCritterArmedPlayer 
{
DECLARE_SERIAL(cCritterBallworldPlayer)
public:
	cCritterBallworldPlayer(cGame *pownergame = NULL);
	BOOL collide(cCritter *pcritter);
};

class cCritterBallProp : public cCritter //A ball with friction & gravity
{
DECLARE_SERIAL(cCritterBallProp)
public:
	cCritterBallProp(cGame *pownergame = NULL);
	void update(CPopView *pactiveview, Real dt); // do a delete_me if you hit the left end
	void die(); //Overload to give score to the player when it jumps on it.
};

class cCritterTreasure : public cCritter
{ //A hollow circle.  objects disappear when they get fully inside it.
DECLARE_SERIAL(cCritterTreasure)
public:
	cCritterTreasure(cGame *pownergame = NULL);
	virtual BOOL collide(cCritter *pcritter); //Checks if pcritter inside.
	int cCritterTreasure::collidesWith(cCritter *pothercritter); /* Only collide
		with cCritterBallworldPlayer. */
};

//======================cGameBallworld==========================

class cGameBallworld : public cGame
{
DECLARE_SERIAL(cGameBallworld);
public:
	static Real TREASURERADIUS;
private:
	cCritterTreasure* _ptreasure;
public:
	cGameBallworld();
	virtual int worldShape(){return cGame::SHAPE_XSCROLLER;} 
		/* Need this to signal the cCritterViewer to not wobble up and down when
		 _trackplayer is on. Overrides the default worldShape of cGame::SHAPE_RECT.*/
	virtual void seedCritters();
	virtual void initializeView(CPopView *pview);
	virtual void initializeViewpoint(cCritterViewer *pviewer); /* Move over to be above the
		lower left corner where the player is.  In 3D, use a low viewpoint low looking up. */
	virtual void adjustGameParameters();
	virtual CString statusMessage();
	virtual void Serialize(CArchive& ar);
};

#endif //GAMEBALLWORLD_H