diff options
Diffstat (limited to 'src/game/game.hpp')
-rw-r--r-- | src/game/game.hpp | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/src/game/game.hpp b/src/game/game.hpp index b2bf0dd..e2ac514 100644 --- a/src/game/game.hpp +++ b/src/game/game.hpp @@ -40,15 +40,20 @@ namespace game { } spider_assets_t; typedef struct { + render::animated_texture_t idle, dead; + } nest_assets_t; + + typedef struct { render::animated_texture_t blood; } fx_assets_t; typedef struct { - render::animated_texture_t stone, eyething, nest; + render::animated_texture_t stone, eyething; } deco_assets_t; extern soldier_assets_t soldier; extern spider_assets_t spider; + extern nest_assets_t nest; extern fx_assets_t fx; extern deco_assets_t deco; @@ -70,6 +75,7 @@ namespace game { SAY_MOVING, UNIT_NAME_SPIDER, UNIT_NAME_SOLDIER, + UNIT_NAME_NEST, UNIT_DEATH, UNIT_ATTACK, UNIT_MISS, @@ -94,7 +100,7 @@ namespace game { void place(world::world_t *world); void place(world::world_t *world, v2f_t x_); - bool always_awake = false; + bool ignore_waking = false; bool awake = false; double wake_time = -INFINITY; void wake(void); @@ -115,7 +121,8 @@ namespace game { typedef enum { UNIT_SOLDIER, - UNIT_SPIDER + UNIT_SPIDER, + UNIT_NEST } type_t; type_t type; @@ -189,6 +196,20 @@ namespace game { void on_death(void); }; + class unit_nest_t : public unit_t { + double next_spawning = -INFINITY; + + public: + unit_nest_t(game::state_t *game_); + ~unit_nest_t(void) {}; + void render_to(render::state_t *render); + + void on_think(void); + void on_spawn(void); + void on_death(void); + void on_wake(void) {}; + }; + class effect_t : public game::entity_t { public: double ttl = +INFINITY; @@ -225,8 +246,7 @@ namespace game { typedef enum { DECO_STONE, DECO_STONE_SMALL, - DECO_EYETHING, - DECO_NEST + DECO_EYETHING } deco_type_t; class deco_t : public game::entity_t { |