X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fspecial.h;h=304d209071e5335cf73412bb56a79b7a918641a2;hb=157cef71aeb9ae25b7bb90f37dda11bc09329d11;hp=7ba652dcd1bb329e5384a4c65901ccd472ed50ab;hpb=84160722392a024dda42bd86ca9bd85b68c49457;p=supertux.git diff --git a/src/special.h b/src/special.h index 7ba652dcd..304d20907 100644 --- a/src/special.h +++ b/src/special.h @@ -17,9 +17,6 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -#define BULLET_STARTING_YM 1 -#define BULLET_XM 5 - #ifndef SUPERTUX_SPECIAL_H #define SUPERTUX_SPECIAL_H @@ -35,6 +32,7 @@ enum UpgradeKind { UPGRADE_GROWUP, + UPGRADE_FIREFLOWER, UPGRADE_ICEFLOWER, UPGRADE_HERRING, UPGRADE_1UP @@ -43,45 +41,49 @@ enum UpgradeKind { void load_special_gfx(); void free_special_gfx(); -class Upgrade +class Upgrade : public MovingObject, public Drawable { public: UpgradeKind kind; - int dir; - base_type base; - base_type old_base; + Direction dir; Physic physic; - void init(float x, float y, int dir, UpgradeKind kind); - void action(double frame_ratio); - void draw(); - void collision(void* p_c_object, int c_object); + Upgrade(DisplayManager& display_manager, const Vector& pos, Direction dir, + UpgradeKind kind); + virtual ~Upgrade(); + + virtual void action(float frame_ratio); + virtual void draw(Camera& viewport, int layer); + + virtual void collision(const MovingObject& other, int); + void collision(void* p_c_object, int c_object, CollisionType type); private: - /** removes the Upgrade from the global upgrade list. Note that after this - * call the class doesn't exist anymore! So don't use any member variables - * anymore then - */ - void remove_me(); + void bump(Player* player); +}; + +enum BulletsKind { + FIRE_BULLET, + ICE_BULLET }; -class Bullet +class Bullet : public MovingObject, public Drawable { - public: - base_type base; - base_type old_base; +public: + Bullet(DisplayManager& manager, const Vector& pos, float xm, int dir, + int kind); - void init(float x, float y, float xm, int dir); - void action(double frame_ratio); - void draw(); + virtual void action(float frame_ratio); + virtual void draw(Camera& viewport, int layer); void collision(int c_object); + virtual void collision(const MovingObject& other_object, int type); + + int kind; + private: - /** removes the Upgrade from the global upgrade list. Note that after this - * call the class doesn't exist anymore! So don't use any member variables - * anymore then - */ - void remove_me(); + int life_count; + Physic physic; }; #endif /*SUPERTUX_SPECIAL_H*/