summaryrefslogtreecommitdiff
path: root/src/game/game.hpp
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2017-12-16 22:41:48 +0000
committerPaweł Redman <pawel.redman@gmail.com>2017-12-16 22:41:48 +0000
commit38edebe4bdeb8caedccf6127a86fddfe9c5808a8 (patch)
tree466cf659201a66a12d922943337e636b5125bccb /src/game/game.hpp
parent5c7d962e605e123e1ce4e0610e8f330b1f4f5e82 (diff)
Fully working nests.
Diffstat (limited to 'src/game/game.hpp')
-rw-r--r--src/game/game.hpp30
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 {