/* * ShipClass.h * * Ship class definition. * */ class Ship: public MovingObject { /* * private: * intPos Old; * floatPos center; * floatPos vector; * Rect bounds; * float radius; * * public: * void moveOnScreen(void*); * virtual void erase(); * virtual void draw(); * virtual void destroy(); * */ public: Ship(); // Desc: Default constructor; // Usage: Should define all variables; // Usage: center will be (0.5, 0.5); // Usage: vector will be (0.0, 0.0); // Usage: radius may be around .5 or so; ~Ship(); // Desc: Destructor; // Usage: Set all data members to NULL or zero; int direction; // Desc: The degree direction the ship is facing; 0 = up, and increasing anti-clockwise; // Usage: Used in draw() to know what orientation to draw; // Usage: Updated in the key handling function; // Init: 0, Facing upwards; int life; // Desc: The number of lives this ship has remaining; // Usage: Could be treated as a bool in the game's event loop; // Usage: Decremented in destroy() when the player is shot or collides with an astroid; // Init: Three sounds good. }