forked from Hartmut/paradiso
Update the plane animtion on the start
This commit is contained in:
parent
c82dcc9081
commit
64311c8a4d
1 changed files with 6 additions and 1 deletions
|
@ -376,7 +376,7 @@ struct Plane {
|
||||||
init_aabb();
|
init_aabb();
|
||||||
}
|
}
|
||||||
|
|
||||||
void update(const paradiso::Window::KeyboardInputStack& input) {
|
void update_animation() {
|
||||||
if (anim_counter < ANIM_INTERVAL) {
|
if (anim_counter < ANIM_INTERVAL) {
|
||||||
anim_counter++;
|
anim_counter++;
|
||||||
} else {
|
} else {
|
||||||
|
@ -389,6 +389,10 @@ struct Plane {
|
||||||
anim_direction = 1;
|
anim_direction = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void update(const paradiso::Window::KeyboardInputStack& input) {
|
||||||
|
update_animation();
|
||||||
|
|
||||||
if (input.size() && input.top().key == ACTION_KEY &&
|
if (input.size() && input.top().key == ACTION_KEY &&
|
||||||
input.top().action == 1) {
|
input.top().action == 1) {
|
||||||
|
@ -654,6 +658,7 @@ struct App {
|
||||||
}
|
}
|
||||||
|
|
||||||
background.update();
|
background.update();
|
||||||
|
plane.update_animation(); // Only the animation.
|
||||||
ground.update();
|
ground.update();
|
||||||
start_ui.update();
|
start_ui.update();
|
||||||
} else if (game_state == GameState::Playing) {
|
} else if (game_state == GameState::Playing) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue