| 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 AJ Thomson |
| 17 | * |
| 18 | * OpenJazz is distributed under the terms of |
| 19 | * the GNU General Public License, version 2.0 |
| 20 | * |
| 21 | */ |
| 22 | |
| 23 | |
| 24 | #ifndef _BIRD_H |
| 25 | #define _BIRD_H |
| 26 | |
| 27 | |
| 28 | #include "level/movable.h" |
| 29 | #include "OpenJazz.h" |
| 30 | |
| 31 | |
| 32 | // Constants |
| 33 | |
| 34 | // Time interval |
| 35 | #define T_BIRD_FIRE 500 |
| 36 | |
| 37 | |
| 38 | // Classes |
| 39 | |
| 40 | class JJ1LevelPlayer; |
| 41 | |
| 42 | /// JJ1 bird companion |
| 43 | class JJ1Bird : public Movable { |
| 44 | |
| 45 | private: |
| 46 | JJ1Bird* next; |
| 47 | JJ1LevelPlayer* player; ///< Player that rescued the bird |
| 48 | bool fleeing; ///< Flying away, player having been shot |
| 49 | unsigned int fireTime; ///< Next time the bird will fire |
| 50 | |
| 51 | JJ1Bird* remove (); |
| 52 | |
| 53 | public: |
| 54 | JJ1Bird (JJ1Bird* birds, JJ1LevelPlayer* player, unsigned char gX, unsigned char gY); |
| 55 | ~JJ1Bird (); |
| 56 | |
| 57 | int getFlockSize (); |
| 58 | JJ1LevelPlayer* getPlayer (); |
| 59 | void hit (); |
| 60 | JJ1Bird* setFlockSize (int size); |
| 61 | |
| 62 | JJ1Bird* step (unsigned int ticks); |
| 63 | void draw (unsigned int ticks, int change); |
| 64 | |
| 65 | }; |
| 66 | |
| 67 | #endif |
| 68 |