Update the plane animtion on the start

This commit is contained in:
brxxh 2025-05-31 00:08:01 +02:00
parent c82dcc9081
commit 64311c8a4d

View file

@ -376,7 +376,7 @@ struct Plane {
init_aabb();
}
void update(const paradiso::Window::KeyboardInputStack& input) {
void update_animation() {
if (anim_counter < ANIM_INTERVAL) {
anim_counter++;
} else {
@ -389,6 +389,10 @@ struct Plane {
anim_direction = 1;
}
}
}
void update(const paradiso::Window::KeyboardInputStack& input) {
update_animation();
if (input.size() && input.top().key == ACTION_KEY &&
input.top().action == 1) {
@ -654,6 +658,7 @@ struct App {
}
background.update();
plane.update_animation(); // Only the animation.
ground.update();
start_ui.update();
} else if (game_state == GameState::Playing) {