From a4ffacdb1854ce8499903a2fa012cef2e89287ec Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Fri, 6 Feb 2026 12:23:17 -0500 Subject: [PATCH] Fix up the animator to show the initial form. --- assets/animate2.json | 2 +- tests/animate2.cpp | 2 ++ tools/animator.cpp | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/assets/animate2.json b/assets/animate2.json index 814ab10..028761d 100644 --- a/assets/animate2.json +++ b/assets/animate2.json @@ -30,7 +30,7 @@ "min_y": -20.0, "max_x": 20.0, "max_y": 20.0, - "simple": true, + "simple": false, "flipped": true, "ease_rate": 5.0, "scaled": true, diff --git a/tests/animate2.cpp b/tests/animate2.cpp index 1ced87d..2f185bd 100644 --- a/tests/animate2.cpp +++ b/tests/animate2.cpp @@ -17,6 +17,8 @@ using namespace animate2; Animate2 load_animation(const string& name) { auto anim = animate2::load("assets/animate2.json", "rat_king_boss"); + anim.set_form("attack"); + anim.transform.looped = false; anim.sequence.durations = {Random::milliseconds(5, 33), Random::milliseconds(5, 33)}; return anim; diff --git a/tools/animator.cpp b/tools/animator.cpp index 1d5b0c6..ea504a4 100644 --- a/tools/animator.cpp +++ b/tools/animator.cpp @@ -40,7 +40,7 @@ namespace animator { $ui.init($sprite_name, $background, new_size.x, new_size.y); $sprite = $ui.get_sprite(); - // need to keep these aroung + // need to keep these around $pos = $sprite->getPosition(); $scale = $sprite->getScale(); @@ -48,6 +48,8 @@ namespace animator { $window.setVerticalSyncEnabled(VSYNC); if(FRAME_LIMIT) $window.setFramerateLimit(FRAME_LIMIT); } + + $ui.update_status($anim); } void FSM::event(Event ev, std::any data) {