Fix up the animator to show the initial form.
This commit is contained in:
parent
4356b1535e
commit
a4ffacdb18
3 changed files with 6 additions and 2 deletions
|
|
@ -30,7 +30,7 @@
|
||||||
"min_y": -20.0,
|
"min_y": -20.0,
|
||||||
"max_x": 20.0,
|
"max_x": 20.0,
|
||||||
"max_y": 20.0,
|
"max_y": 20.0,
|
||||||
"simple": true,
|
"simple": false,
|
||||||
"flipped": true,
|
"flipped": true,
|
||||||
"ease_rate": 5.0,
|
"ease_rate": 5.0,
|
||||||
"scaled": true,
|
"scaled": true,
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,8 @@ using namespace animate2;
|
||||||
|
|
||||||
Animate2 load_animation(const string& name) {
|
Animate2 load_animation(const string& name) {
|
||||||
auto anim = animate2::load("assets/animate2.json", "rat_king_boss");
|
auto anim = animate2::load("assets/animate2.json", "rat_king_boss");
|
||||||
|
anim.set_form("attack");
|
||||||
|
|
||||||
anim.transform.looped = false;
|
anim.transform.looped = false;
|
||||||
anim.sequence.durations = {Random::milliseconds(5, 33), Random::milliseconds(5, 33)};
|
anim.sequence.durations = {Random::milliseconds(5, 33), Random::milliseconds(5, 33)};
|
||||||
return anim;
|
return anim;
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ namespace animator {
|
||||||
$ui.init($sprite_name, $background, new_size.x, new_size.y);
|
$ui.init($sprite_name, $background, new_size.x, new_size.y);
|
||||||
$sprite = $ui.get_sprite();
|
$sprite = $ui.get_sprite();
|
||||||
|
|
||||||
// need to keep these aroung
|
// need to keep these around
|
||||||
$pos = $sprite->getPosition();
|
$pos = $sprite->getPosition();
|
||||||
$scale = $sprite->getScale();
|
$scale = $sprite->getScale();
|
||||||
|
|
||||||
|
|
@ -48,6 +48,8 @@ namespace animator {
|
||||||
$window.setVerticalSyncEnabled(VSYNC);
|
$window.setVerticalSyncEnabled(VSYNC);
|
||||||
if(FRAME_LIMIT) $window.setFramerateLimit(FRAME_LIMIT);
|
if(FRAME_LIMIT) $window.setFramerateLimit(FRAME_LIMIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$ui.update_status($anim);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FSM::event(Event ev, std::any data) {
|
void FSM::event(Event ev, std::any data) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue