diff options
Diffstat (limited to 'game-state.h')
-rw-r--r-- | game-state.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/game-state.h b/game-state.h new file mode 100644 index 0000000..78e423f --- /dev/null +++ b/game-state.h @@ -0,0 +1,43 @@ +#ifndef GAME_STATE_H +#define GAME_STATE_H + +#include <raylib.h> + +#include "player.h" +#include "def.h" +#include "enemy.h" +#include "tower.h" + +extern const enemy_spawner_t DEFAULT_ENEMY_SPAWNER; +#define ENEMY_COUNT_MAX 1000 +#define TOWER_COUNT_MAX 100 +#define MAX_BEAM_COUNT 100 +/* extern const int ENEMY_COUNT_MAX; */ +/* extern const int TOWER_COUNT_MAX; */ + +typedef struct GameState { + player_t player; + tower_t towers[TOWER_COUNT_MAX]; + int tower_count; + enemy_t enemies[ENEMY_COUNT_MAX]; + int enemy_count; + tower_beam_t beams[MAX_BEAM_COUNT]; + int beam_count; + enemy_spawner_t spawner; + Texture2D *textures; + RenderTexture2D bg_tiles; +} gs_t; + +float mouse_x(gs_t *gs); +float mouse_y(gs_t *gs); + +void add_tower(gs_t *gs, tower_t tower); +void add_enemy(gs_t *gs, enemy_t enemy); +void add_beam(gs_t *gs, tower_beam_t beam); +void kill_enemy(gs_t *gs, int index); +void update_game(gs_t *gs, float dt); +void draw_game(gs_t *gs); + +void paint_tile(); + +#endif |