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

#ifndef GAMEBALLWORLD_H
#define GAMEBALLWORLD_H

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

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

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

class cCritterFunThing : public cCritter
{
DECLARE_SERIAL(cCritterFunThing)
public:
	int bonus;
	cCritterFunThing(cGame *pownergame = NULL);
	void update(CPopView *pactiveview, Real dt);
//	int cCritterFunThing::collidesWith(cCritter *pothercritter); /* Only collide
//		with cCritterBallworldPlayer. */
	virtual BOOL collide(cCritter *pcritter); //Checks if pcritter inside.
	void die();
};

class cCritterAddAmmo : public cCritter
{
DECLARE_SERIAL(cCritterAddAmmo)
public:
	cCritterAddAmmo(cGame *pownergame = NULL);
	void update(CPopView *pactiveview, Real dt);
	virtual BOOL collide(cCritter *pcritter); //Checks if pcritter inside.
};
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. */
};

class cCritterBallworldPlayer : public cCritterArmedPlayer 
{
DECLARE_SERIAL(cCritterBallworldPlayer)
public:
	int ammo;
	cCritterBallworldPlayer(cGame *pownergame = NULL);
	cCritterBullet* shoot();
	BOOL collide(cCritter *pcritter);
	//BOOL collide(cCritterBallProp *pcritter);
	//BOOL collide(cCritterFunThing *pcritter);
	virtual void addHealth(int healthchange);
	virtual int damage(int hitstrength);
};
//======================cGameBallworld==========================

class cGameBallworld : public cGame
{
DECLARE_SERIAL(cGameBallworld);
public:
	static Real TREASURERADIUS;
	static Real WALLTHICKNESS;
	int level;
private:
	cCritterTreasure* _ptreasure;
	cCritterWall* walls[25];
public:
	cGameBallworld();
	void nextLevel(cCritter *);
	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