pass pause state to enemy projector animations

This commit is contained in:
ohsqueezy 2023-12-05 13:49:11 -05:00
parent 2e0b571f19
commit 26c5312567
4 changed files with 7 additions and 3 deletions

View File

@ -52,7 +52,6 @@
"qr translation": [1.49, -0.7],
"qr scale": [0.205, 0.225],
"end screen timeout": 40.0,
"end screen timeout": 10040.0,
"enemy sprite scale": 0.024691358,
"quest best text": "BEST ",
"quest best scale": [0.31, 0.04],

2
lib/sb

@ -1 +1 @@
Subproject commit 5750997d5c7ef0a4fd9b41e0e4ba566d3a3907d2
Subproject commit a6a110141d3e6bfbc66a7b6065a3199c76ba8ae9

View File

@ -906,7 +906,7 @@ void Cakefoot::load_level(int index)
/* The wrap space of the field is necessary for flame enemy objects */
sb::Box field {-curve().aspect, -1.0f, 2.0f * curve().aspect, 2.0f};
/* Query the end screen to time out */
/* Time out end screen */
if (static_cast<std::size_t>(index) == configuration()("levels").size() - 1)
{
submit_score_animation.play_once(configuration()("display", "end screen timeout"));

View File

@ -347,6 +347,7 @@ void Projector::reset()
projectiles.clear();
animation_release.pause();
count = 0;
sprite.texture_index(0);
}
void Projector::coin(const sb::Sprite& sprite, int frequency)
@ -363,6 +364,10 @@ void Projector::update(const sb::Timer& timer)
animation_charge.update(timer.stamp());
animation_release.update(timer.stamp());
/* Set play state based on unpaused timer state */
animation_charge.toggle(timer);
animation_release.toggle(timer);
/* Erase projectiles which have gone off screen */
projectiles.erase(
std::remove_if(