00001 00007 #ifndef _HOMINGBOMB_H_ 00008 #define _HOMINGBOMB_H_ 00009 00010 #include "IsoBomb.h" 00011 #include "Bomb.h" 00012 #include "Character.h" 00013 #include "AStar.h" 00014 #include "SoundSystem.h" 00015 00019 class HomingBomb : public Bomb { 00020 00021 public: 00022 00026 HomingBomb(); 00027 00038 HomingBomb( const Rect& initPos, int initDir, int size, 00039 float delay, float initSpeed, const Character* c ); 00040 00044 virtual ~HomingBomb(); 00045 00052 virtual bool update( float dt ); 00053 00059 virtual void draw( const Point& anchor ); 00060 00061 private: 00062 00068 void move( float dt ); 00069 00075 bool hasReachedDestination(); 00076 00083 bool getNextDestination(); 00084 00089 void keepInCenter(); 00090 00091 private: 00092 00096 const Character* target; 00097 00101 Rect targetPos; 00102 00106 float speed; 00107 00111 AStar finder; 00112 00116 Point destPoint; 00117 00121 int direction; 00122 00126 Animation feetAnim; 00127 00131 bool hasPath; 00132 00136 bool firstTime; 00137 00141 SoundToken sound; 00142 }; 00143 00144 #endif