fp: Smoochie attack on aggro, add heart anim on attack

This commit is contained in:
2023-09-26 23:58:48 +10:00
parent 5e441e1a13
commit a9fba6f01d
13 changed files with 198 additions and 94 deletions
+34 -4
View File
@@ -48,11 +48,26 @@ struct FP_GameEntityHandle
uint64_t id;
};
enum FP_GameWaypointArrive
{
// Considered arrived when within 1 meter of the target (`value` is ignored).
FP_GameWaypointArrive_Default,
// If set, we consider the entity as arriving at the waypoint when it's
// distance to the target is:
//
// `arrived = dist <= (entity_hit_box_size * value)`
//
// A value of 0 for example means we are considered arrived when the entity
// is positioned exactly on top of the target's position.
FP_GameWaypointArrive_WhenWithinEntitySize,
};
struct FP_GameWaypoint
{
Dqn_V2I pos;
FP_GameWaypoint *next;
FP_GameWaypoint *prev;
FP_GameEntityHandle entity;
FP_GameWaypointArrive arrive;
Dqn_f32 value;
};
struct FP_GameEntitySpawnList
@@ -86,6 +101,15 @@ enum FP_GameDirection
FP_GameDirection_Right,
};
struct FP_GameRenderSprite
{
Dqn_V2 offset;
TELY_AssetAnimatedSprite asset;
bool loop;
FP_Meters height;
uint64_t started_at_clock_ms;
};
struct FP_GameEntity
{
FP_GameEntity *next;
@@ -104,7 +128,12 @@ struct FP_GameEntity
FP_GameEntityAction action;
Dqn_V2 velocity;
FP_SentinelList<FP_GameEntityHandle> waypoints;
// Extra animations that are to be executed, but, don't affect the state
// of the entity. For example, when Smoochie attacks, we have a heart
// animation that is a seperate sprite that will play out.
Dqn_FArray<FP_GameRenderSprite, 2> extra_cosmetic_anims;
FP_SentinelList<FP_GameWaypoint> waypoints;
// NOTE: The entity hit box is positioned at the center of the entity.
Dqn_V2 local_hit_box_size;
@@ -181,6 +210,7 @@ struct FP_Game
Dqn_f32 meters_to_pixels;
uint64_t clock_ms;
Dqn_PCG32 rng;
};
struct FP_GameAStarNode