From 1b6ecc22e77b7aa1fee16420b041c1dea1925052 Mon Sep 17 00:00:00 2001 From: riton Date: Sat, 29 Mar 2025 21:37:46 +0300 Subject: init repo --- game-state.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 game-state.h (limited to 'game-state.h') 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 + +#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 -- cgit v1.2.3