// Hero.hpp : Hero class // // 08.09.1998 / DH - First release // 16.11.1998 / DH - Hero torch light // 24.11.1998 / DH - Bullet moved // // Copyright (c) 1998 Daniel Hartmeier. All rights reserved. #ifndef __Hero__ #define __Hero__ class Hero; class Bullet; #include "Handler.hpp" #include "Light.hpp" // ------------------------------------------------------------------- class Hero : public PersonSprite { public: Hero(Handler &handler); virtual ~Hero(); virtual void reset(); virtual void act(unsigned long pad); virtual int direction() const { return direction_; } virtual void setLight(Light *light) { this->light = light; return; } virtual void move(int x, int y) { if (light) light->move(x, y); PersonSprite::move(x, y); return; } protected: private: Handler &handler; int direction_; // 1 = facing right, -1 = facing left int step; bool released; Light *light; }; // ------------------------------------------------------------------- class Bullet : public ActiveSprite { public: Bullet(const Sprite *parent); virtual ~Bullet(); virtual void draw(GsOT *ot); virtual void act(unsigned long pad); virtual void explode(); virtual bool isExploding() const { return exploding; } virtual bool isGone() const { return gone; } virtual const Sprite *parent() const { return parent_; } protected: int step; bool exploding, gone; private: const Sprite *parent_; }; // ------------------------------------------------------------------- class Fireball : public Bullet { public: Fireball(const Sprite *parent) : Bullet(parent) { setSize(16, 16); } virtual void draw(GsOT *ot); protected: private: }; // ------------------------------------------------------------------- #endif