fp: Start drafting up swarming of buildings

This commit is contained in:
2023-09-29 22:44:27 +10:00
parent 158fcb12fe
commit a35cb8d2a6
3 changed files with 117 additions and 7 deletions
+14 -5
View File
@@ -66,8 +66,9 @@ enum FP_GameWaypointArrive
enum FP_GameWaypointType
{
FP_GameWaypointType_At, // Move to the specified entity
FP_GameWaypointType_Side, // Move to the side of the entity specified by the direction
FP_GameWaypointType_At, // Move to the specified entity
FP_GameWaypointType_Side, // Move to the side of the entity specified by the direction
FP_GameWaypointType_Offset, // Move to the designed offset from the entity
};
enum FP_GameDirection
@@ -82,10 +83,11 @@ enum FP_GameDirection
struct FP_GameWaypoint
{
FP_GameWaypointType type;
FP_GameDirection type_direction;
FP_GameEntityHandle entity;
FP_GameDirection type_direction; // Used if type is `FP_GameWaypointType_Side`
FP_GameEntityHandle entity; // The entity to move to
FP_GameWaypointArrive arrive;
Dqn_f32 value;
Dqn_f32 value; // Used for `arrive` threshold
Dqn_V2 offset; // Used if type is `FP_GameWaypointType_Offset`
};
struct FP_GameEntitySpawnList
@@ -120,6 +122,12 @@ struct FP_GameRenderSprite
uint64_t started_at_clock_ms;
};
struct FP_GameSwarm
{
Dqn_FArray<FP_SentinelList<FP_GameEntityHandle>, 8> slots;
Dqn_usize slots_active;
};
struct FP_GameEntity
{
FP_GameEntity *next;
@@ -145,6 +153,7 @@ struct FP_GameEntity
FP_SentinelList<FP_GameWaypoint> waypoints;
FP_GameEntityHandle aggro_slot[FP_GameDirection_Count];
FP_GameSwarm swarm[FP_GameDirection_Count];
// NOTE: The entity hit box is positioned at the center of the entity.
Dqn_V2 local_hit_box_size;