home *** CD-ROM | disk | FTP | other *** search
- #ifndef __stealth_h
- #define __stealth_h
-
- #include "plane.h"
- #include "plasma.h"
- #include "global.h"
-
- //--------------------------------------
- // Stealth
- // the player's ship
- // maintains a plasma ( his weapon ) list
- // responds to GO LEFT, GO RIGHT, and FIRE
- // draws itself
- //--------------------------------------
- class Stealth : public Plane
- {
- // data
- private:
- int MoveLength;
- protected:
- Plasma plasma[15];
- public:
-
- // functions
- private:
- protected:
- public:
- Stealth() { MoveLength = 4; }
- void Setup( Director* director ); // sets up stealth
- void Reset(void); // sets stealth at initial location
- void OnLeftKey(); // response function for GO LEFT
- void OnRightKey(); // response function for GO RIGHT
- void OnUpKey(); // response function for GO UP
- void OnDownKey(); // response function for GO DOWN
- void OnFireKey(); // response function for FIRE weapons
- void OnMove(int,int);
- void OnDraw(void); // draws ship's image
- void initialize();
- void SoundDestroy(void);
- };
-
- inline void Stealth::OnLeftKey()
- {
- int x=loc.x-=(loc.x-MoveLength>=0) ? MoveLength:0;
- StealthRect.l=x, StealthRect.r=x+width;
- }
- inline void Stealth::OnRightKey()
- {
- int x=loc.x+=(loc.x+MoveLength<=320-width) ? MoveLength:0;
- StealthRect.l=x, StealthRect.r=x+width;
- }
- inline void Stealth::OnUpKey()
- {
- int y=loc.y-=(loc.y-MoveLength>=0) ? MoveLength:0;
- StealthRect.t=y, StealthRect.b=y+height;
- }
- inline void Stealth::OnDownKey()
- {
- int y=loc.y+=(loc.y+MoveLength<=200-height) ? MoveLength:0;
- StealthRect.t=y, StealthRect.b=y+height;
- }
-
- #endif //__stealth_h
-