A common mistake that newbies make is to sample the input for the demo mode at a point in the event loop before or after the normal input is read.
一个新手常犯的错误是这样的,为游戏演示所进行的采样超前或落后于游戏的正确输入时刻。
Note that the extension is easy to understand and modify, and that it can do the job just as well as the previous, non-parsing example (see the Event loop with command-line switches).
请注意,很容易理解和修改这个扩展,而且该扩展可以与前面的非解析示例一样出色地完成工作(请参阅带命令行开关的事件循环)。
It's possible that the player might have the fire button down in one part of the event loop and not in another, so you must sample at the same point you read the input for the game normally.
其可能造成的结果是游戏玩家在游戏事件循环的某一部分按下了发射键,而在另一部分却松开了它。所以必须在同一处进行采样与读入输入。
应用推荐