fp: Use animated sprites, use ms for animation duration

This commit is contained in:
2023-09-24 23:08:30 +10:00
parent 858a66786a
commit 677486e094
4 changed files with 161 additions and 176 deletions
+8 -13
View File
@@ -60,27 +60,20 @@ struct FP_GameEntitySpawnList
FP_GameEntitySpawnList *prev;
};
enum FP_GameEntityActionFlag
{
FP_GameEntityActionFlag_StateTransition = 1 << 0,
FP_GameEntityActionFlag_Failed = 1 << 1,
};
struct FP_GameEntityActionSprite
{
TELY_AssetSpriteSheet *sheet;
TELY_AssetSpriteAnimation *anim;
};
Dqn_f32 const FP_GAME_ENTITY_ACTION_INFINITE_TIMER = -1.f;
uint64_t const FP_GAME_ENTITY_ACTION_INFINITE_TIMER = UINT64_MAX;
struct FP_GameEntityAction
{
bool flip_on_x;
uint32_t state;
uint32_t flags; // Bit flags corresponding with `FP_GameEntityActionFlag`
FP_GameEntityActionSprite sprite;
Dqn_f32 timer_s;
Dqn_f32 end_at_s;
uint32_t state;
uint32_t next_state;
TELY_AssetAnimatedSprite sprite;
uint64_t started_at_clock_ms;
uint64_t end_at_clock_ms;
};
enum FP_GameDirection
@@ -183,6 +176,8 @@ struct FP_Game
FP_GameCamera camera;
TELY_RFui rfui;
uint64_t clock_ms;
};
struct FP_GameAStarNode