除此之外,游戏更新函数实现起来比固定帧速率更麻烦。所以为什么还要用它呢?
And besides, the implementation of the game update function is harder than when you use a fixed frame rate, so why use it?
在我们最先的解决方法,FPS基于固定的游戏速度,在低速的硬件下会有问题,游戏速度和帧速率都会有丢失。
Our first solution, FPS dependent on Constant game speed, has a problem when running on slow hardware. Both the game speed and the framerate will drop in that case.
计时问题的一个简单解决方法是让游戏固定运行在25帧每秒。
An easy solution to the timing issue is to just let the game run on a steady 25 frames per second. The code then looks like this.
应用推荐