Skip to content

Commit

Permalink
GameEngine.h:
Browse files Browse the repository at this point in the history
* Only updating frame_ctr, anim_ctr variables and sim_time_s when neither of title, instructions quit-confirm, input-hiscore, show-hiscore or pause screens are shown. I think is the most useful way to do it and probably expected to behave like that.
  • Loading branch information
razterizer committed Nov 20, 2024
1 parent fb2ee2a commit cd96cb6
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions GameEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -498,12 +498,15 @@ class GameEngine

///

frame_ctr++;
for (auto& ad : anim_ctr_data)
if (frame_ctr % ad.anim_count_per_frame_count == 0)
ad.anim_ctr++;

sim_time_s += sim_dt_s;
if (!show_title && !show_instructions && !show_quit_confirm && !show_input_hiscore && !show_hiscores && !paused)
{
frame_ctr++;
for (auto& ad : anim_ctr_data)
if (frame_ctr % ad.anim_count_per_frame_count == 0)
ad.anim_ctr++;

sim_time_s += sim_dt_s;
}

return true;
}
Expand Down

0 comments on commit cd96cb6

Please sign in to comment.