62 lines
1.1 KiB
C
62 lines
1.1 KiB
C
#ifndef PIXELDEFENSE_GAME_STATE_H
|
|
#define PIXELDEFENSE_GAME_STATE_H
|
|
|
|
#include <breeze.h>
|
|
#include <flecs.h>
|
|
|
|
typedef enum GameScreen {
|
|
SCREEN_GAME,
|
|
SCREEN_PAUSE_MENU,
|
|
SCREEN_MAIN_MENU,
|
|
SCREEN_SETTINGS,
|
|
} GameScreen;
|
|
|
|
typedef struct DrawData {
|
|
Texture tex;
|
|
Rectangle src;
|
|
Rectangle dst;
|
|
Vector2 origin;
|
|
f32 rotation;
|
|
} DrawData;
|
|
|
|
typedef struct Game {
|
|
GameScreen screen;
|
|
Camera2D camera;
|
|
BzTileset tileset;
|
|
BzTileMap map;
|
|
BzSpatialGrid *entityGrid;
|
|
f32 frameDuration;
|
|
|
|
Font font;
|
|
|
|
struct {
|
|
i64 wood;
|
|
i64 iron;
|
|
i64 food;
|
|
i64 gold;
|
|
i64 pop;
|
|
} resources;
|
|
BzStackAlloc stackAlloc;
|
|
struct {
|
|
BzObjectPool *pathData;
|
|
BzObjectPool *actions;
|
|
} pools;
|
|
struct {
|
|
bool drawPath;
|
|
bool drawEntityColliders;
|
|
bool drawMapColliders;
|
|
bool drawSpatialGrid;
|
|
ecs_entity_t *inspecting;
|
|
} debug;
|
|
f32 elapsed;
|
|
|
|
ecs_query_t *drawQuery;
|
|
DrawData *drawData;
|
|
} Game;
|
|
|
|
extern ecs_world_t *ECS;
|
|
|
|
extern ECS_COMPONENT_DECLARE(Game); // defined in main.c
|
|
|
|
#endif //PIXELDEFENSE_GAME_STATE_H
|