home *** CD-ROM | disk | FTP | other *** search
- #ifndef __weapon_h
- #define __weapon_h
-
- #include "object.h"
-
- //--------------------------------------
- // WeaponImage
- // enumerations for weapon images
- //--------------------------------------
- enum WeaponImage
- {
- wiLEFT, wiNORMAL, wiRIGHT, wiEXPLODE1, wiEXPLODE2, wiEXLODE3
- };
-
- //--------------------------------------
- // Weapon
- // a weapon
- // maintains a current image index
- // draws itself
- //--------------------------------------
- class Weapon : public Object
- {
- // data
- private:
- protected:
- boolean active; // is weapon on screen?
- WeaponImage image; // the current image of the weapon
- public:
-
- // functions
- private:
- protected:
- public:
- Weapon() { image=wiNORMAL, active=NO; }
- virtual void OnDraw(void) {} // draws weapon's image
- virtual boolean Move(void)=0;
- virtual boolean CheckForCollision()=0;
- boolean IsActive() { return active; }
- void Deactivate(void) { active=NO; }
- void Activate( int X, int Y ) { active=YES, loc.x=X, loc.y=Y; }
-
- };
-
- #endif //__weapon_h