enemy.h (590B)
1 #pragma once 2 3 typedef struct Enemy enemy_t; 4 5 #include "game.h" 6 #include "util.h" 7 8 typedef enum { 9 ENEMY_TEST, 10 } enemy_e; 11 12 struct Enemy { 13 pos_t pos; 14 enemy_e type; 15 bool on_ground; 16 float velocity; 17 float gravity; 18 int dir; 19 bool stunned; 20 bool frozen; 21 int frozen_timer; 22 float fall_height; 23 fz_timer_t *timer_walking; 24 fz_timer_t *timer_sneaking; 25 }; 26 27 enemy_t *enemy_create(pos_t pos, enemy_e type); 28 void enemy_update(enemy_t *enemy, game_t *game); 29 void enemy_draw(enemy_t *enemy, game_t *game); 30 void enemy_kill(enemy_t *enemy, game_t *game); 31 void enemy_free(enemy_t *enemy);