domsson / cong

Pong clone in C++ with SFML - an exercise to learn C++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Game speed not hardware-agnostic

domsson opened this issue · comments

The game should run at the same speed on all machines, but currently it runs noticeably faster on my desktop machine than it does on my laptop. Something must be off in the game's main loop logic.

Fixed by altering the game loop; it is now using the time difference between loops as argument for the updating of the game. Although this is recommended against in several places because of inaccuracies that could accumulate, I decided it would be a good solution for this simple, non-networked game.