1 #ifndef MONSTER_H 2 #define MONSTER_H 3 4 #include "Main.h" 5 #include "Map.h" 6 7 #define MONSTER_CRAB 0 8 #define MONSTER_SMASHER 1 9 #define MONSTER_DEMON 2 10 #define MONSTER_SMASHER2 3 11 #define MONSTER_PLATFORM 4 12 #define MONSTER_PLATFORM2 5 13 #define MONSTER_SPIDER 6 14 #define MONSTER_BEAR 7 15 #define MONSTER_TORCH 8 16 #define MONSTER_ARROW 9 17 #define MONSTER_FIRE 10 18 #define MONSTER_STAR 11 19 #define MONSTER_BULLET 12 20 #define MONSTER_CANNON 13 21 #define MONSTER_CANNON2 14 22 #define MONSTER_BAT 15 23 #define MONSTER_GHOST 16 24 #define MONSTER_END_GAME 17 25 26 #define MONSTER_COUNT 18 27 28 struct _monster; 29 30 // if the intersection of tom and monster is bigger than this number 31 // it is considered a hit. A MONSTER_COLLISION_FUZZ of 0 is the least 32 // tolerant and a TILE_W is the most. Doesn't apply to harmless monsters. 33 #define MONSTER_COLLISION_FUZZ 16 34 35 // The extra number of tiles around the screen 36 // ,.where monsters are still active 37 #define MONSTER_EXTRA_X 80 38 #define MONSTER_EXTRA_Y 60 39 40 // The max amount of speed change 41 #define MAX_RANDOM_SPEED 6.0 42 43 extern Monster monsters[256]; 44 extern LiveMonster live_monsters[256]; 45 extern int live_monster_count; 46 extern int move_monsters; 47 48 void initMonsters(); 49 void resetMonsters(); 50 void addMonsterImage(int monster_index, int image_index); 51 int isMonsterImage(int image_index); 52 53 void addLiveMonster(int monster_index, int image_index, int x, int y); 54 void addLiveMonsterChangeMap(int monster_index, int image_index, int x, int y, 55 int change_map); 56 void removeAllLiveMonsters(); 57 void drawLiveMonsters(SDL_Surface * surface, int start_x, int start_y); 58 void debugMonsters(); 59 60 /** 61 Return live monster if there's a one at position pos, 62 NULL otherwise. 63 */ 64 LiveMonster *detectMonster(Position * pos); 65 66 #endif 67