Partial tower implementation

This commit is contained in:
2024-02-09 15:46:53 +01:00
parent e9b9c68f6b
commit bc7da3c7a3
8 changed files with 171 additions and 3 deletions

View File

@@ -270,6 +270,19 @@ typedef struct Unit {
EntityType unitType;
} Unit;
extern ECS_COMPONENT_DECLARE(Unit);
typedef struct Tower {
f32 range;
f32 minDamage;
f32 maxDamage;
f32 damageFalloff;
f32 damageRadius;
f32 projectileSpeed;
f32 fireCooldown;
f32 fireElapsed;
} Tower;
extern ECS_COMPONENT_DECLARE(Tower);
#define BUILDING_MAX_RECRUIT_SLOTS 4
typedef struct BuildingRecruitSlot {
EntityType entityType;
@@ -301,8 +314,17 @@ extern ECS_TAG_DECLARE(Buildable);
extern ECS_TAG_DECLARE(Attackable);
/**********************************************************
* DelayDelete components
* Misc components
*********************************************************/
typedef u8 DrawLayer;
extern ECS_COMPONENT_DECLARE(DrawLayer);
typedef struct AttachedEntity {
ecs_entity_t entity;
} AttachedEntity;
extern ECS_COMPONENT_DECLARE(AttachedEntity);
typedef struct DelayDelete {
f32 time;
f32 elapsed;