Add building preview

This commit is contained in:
2023-11-16 09:40:41 +01:00
parent c232fc9afd
commit 6974a80611
2 changed files with 56 additions and 18 deletions

View File

@@ -6,6 +6,14 @@
#include "entity_map.h"
typedef enum InputState {
INPUT_NONE,
INPUT_PLACING,
INPUT_DRAGGING,
INPUT_SELECTED_UNITS,
INPUT_SELECTED_OBJECT,
} InputState;
typedef struct Game {
Camera2D camera;
BzTileset terrainTileset;
@@ -14,10 +22,13 @@ typedef struct Game {
BzTileMap map;
EntityMap entityMap;
f32 frameDuration;
Vector2 targetPos;
ecs_entity_t entity;
struct {
InputState state;
int building;
bool buildingCanPlace;
TilePosition buildingPos;
TileSize buildingSize;
Vector2 mouseDown;
f32 mouseDownElapsed;
} input;