diff --git a/examples/tappyplane/tappyplane.cpp b/examples/tappyplane/tappyplane.cpp index 45b4ac5..f1e2a8e 100644 --- a/examples/tappyplane/tappyplane.cpp +++ b/examples/tappyplane/tappyplane.cpp @@ -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) {