Now have animated torches that are defined from json, and smoother animations in the arena.

This commit is contained in:
Zed A. Shaw 2025-10-21 00:21:46 -04:00
parent 387d1a5bf5
commit 7c11ffa2af
10 changed files with 111 additions and 73 deletions

View file

@ -117,7 +117,8 @@ namespace components {
};
struct Animation {
float scale = 1.0f;
float scale_x = 1.0f;
float scale_y = 1.0f;
float max_scale = 1.0f;
bool simple = true;
int frames = 10;
@ -125,10 +126,12 @@ namespace components {
ease::Style easing = ease::IN_OUT_BACK;
float ease_rate = 0.5f;
bool stationary = false;
bool toggled = false;
bool looped = false;
int current = 0;
bool playing = false;
float subframe = 0.0f;
bool looped = false;
// BUG: this is weirdly not used in most animations but also named wrong should be frame_width
int frame_width = -1;
int frame_height = -1;
@ -159,8 +162,8 @@ namespace components {
ENROLL_COMPONENT(Motion, dx, dy, random);
ENROLL_COMPONENT(Combat, hp, max_hp, damage, dead);
ENROLL_COMPONENT(Device, config, events);
ENROLL_COMPONENT(Animation, scale, max_scale, simple, frames,
speed, easing, ease_rate, stationary);
ENROLL_COMPONENT(Animation, scale_x, scale_y, max_scale, simple, frames,
speed, easing, ease_rate, stationary, toggled, looped);
ENROLL_COMPONENT(Sound, attack, death);
ENROLL_COMPONENT(Collision, has);