Advertisement
Le_BuG63

Untitled

Feb 16th, 2015
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.13 KB | None | 0 0
  1. #ifndef __MONSTER_H__
  2. #define __MONSTER_H__
  3.  
  4. #include <SDL\SDL.h>
  5.  
  6. #include "animation.h"
  7. #include "list.h"
  8. #include "vector2d.h"
  9. #include "map.h"
  10.  
  11. enum monster_type {
  12.     MONSTERTYPE_Kobold,
  13.     MONSTERTYPE_Goblin,
  14.     MONSTERTYPE_Zombie,
  15.     MONSTERTYPE_Skeleton,
  16.     MONSTERTYPE_Orc,
  17.     MONSTERTYPE_Golem,
  18.     MONSTERTYPE_Titan,
  19.     MONSTERTYPE_Last
  20. };
  21.  
  22. struct s_monster {
  23.     SDL_Surface **sprites;
  24.     ANIMATION   animation;
  25.  
  26.     VECTOR2D    position;
  27.     VECTOR2D    velocity;
  28.  
  29.     struct {
  30.         int     speed;
  31.         int     armor;
  32.         int     life;
  33.     } stat;
  34.  
  35.     SDL_Rect    hitbox;
  36.  
  37.     int         frame;
  38.  
  39.     enum monster_type   type;
  40. };
  41.  
  42. typedef enum    monster_type    MONSTERTYPE;
  43. typedef struct  s_monster       MONSTER;
  44.  
  45. static list_node    *sList_monster;
  46. static MONSTER      sMonster_array[MONSTERTYPE_Last];
  47.  
  48. void    Monster_setArray(MONSTERTYPE monsterType, const char *monsterPath);
  49.  
  50. void    Monster_addList(MONSTERTYPE monsterType);
  51. void    Monster_freeList(void);
  52. void    Monster_free(MONSTER *monster);
  53. void    Monster_blitsWave(SDL_Surface *screen);
  54.  
  55. void    Monster_handleMovement(MAP *map);
  56.  
  57. static void monster_addsprite(const char *spritesPath, MONSTER *monster);
  58.  
  59. #endif /* __MONSTER_H__ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement