CCScene里在运行一个游戏循环(gameloop,一般是1/60更新一次),然后CCLayer和CCSprite就在这个gameloop里面做一些更新和游戏逻辑。
基于8个网页-相关网页
这序列就是通过游戏循环来实现的。
游戏循环比你想象的要复杂。
游戏循环就像心跳,没有游戏能离开它。
The game loop is the heartbeat of every game, no game can run without it.
I probably whip out a do while loop very rarely, but very often when programming games or any program that takes user input and has to check that user input and yell at the user if they're messing with you or aren't providing what's expected.
我可能很少用do,while,循环,但常常是,当编制程序游戏或需要用户输入的程序是,需要检查用户的输入并提醒用户,如果他们干扰了你,或没有提供所期望的输入。
应用推荐