1 2 /** 3 * 4 * @file jj1bird.h 5 * 6 * Part of the OpenJazz project 7 * 8 * @par History: 9 * - 23rd August 2005: Created OpenJazz.h 10 * - 31st January 2006: Created level.h from parts of OpenJazz.h 11 * - 4th February 2009: Created events.h from parts of level.h 12 * - 1st March 2009: Created bird.h from parts of events.h 13 * - 1st August 2012: Renamed bird.h to jj1bird.h 14 * 15 * @par Licence: 16 * Copyright (c) 2005-2012 Alister Thomson 17 * 18 * OpenJazz is distributed under the terms of 19 * the GNU General Public License, version 2.0 20 * 21 * You should have received a copy of the GNU General Public License 22 * along with this program; if not, write to the Free Software 23 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 24 * 25 */ 26 27 28 #ifndef _BIRD_H 29 #define _BIRD_H 30 31 32 #include "level/movable.h" 33 #include "OpenJazz.h" 34 35 36 // Constants 37 38 // Time interval 39 #define T_BIRD_FIRE 500 40 41 42 // Classes 43 44 class JJ1LevelPlayer; 45 46 /// JJ1 bird companion 47 class JJ1Bird : public Movable { 48 49 private: 50 JJ1Bird* next; 51 JJ1LevelPlayer* player; ///< Player that rescued the bird 52 bool fleeing; ///< Flying away, player having been shot 53 unsigned int fireTime; ///< Next time the bird will fire 54 55 JJ1Bird* remove (); 56 57 public: 58 JJ1Bird (JJ1Bird* birds, JJ1LevelPlayer* player, unsigned char gX, unsigned char gY); 59 ~JJ1Bird (); 60 61 int getFlockSize (); 62 JJ1LevelPlayer* getPlayer (); 63 void hit (); 64 JJ1Bird* setFlockSize (int size); 65 66 JJ1Bird* step (unsigned int ticks); 67 void draw (unsigned int ticks, int change); 68 69 }; 70 71 #endif 72 73