Skip to content

Commit

Permalink
implement rewind for CoreExplosion
Browse files Browse the repository at this point in the history
  • Loading branch information
evanbowman committed Mar 24, 2022
1 parent e3f8143 commit 61c6b46
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions source/skyland/entity/explosion/coreExplosion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,25 @@ class CoreExplosionQuarter : public Entity
}


void rewind(Platform& pfrm, App& app, Microseconds delta) override
{
timer_ -= delta;

if (timer_ < 0) {
timer_ += milliseconds(200);

if (keyframe_ == 0) {
kill();
} else {
if (quarter_ == 0) {
dt_->remap((70 + keyframe_) * 2);
}
keyframe_--;
}
}
}


private:
Platform::DynamicTexturePtr dt_;
Microseconds timer_;
Expand Down

0 comments on commit 61c6b46

Please sign in to comment.