开发者

resetting to initial value

Can anyone please tell me how to reset a mult开发者_JAVA百科iplexlayer scene in cocos2d I want the position, score , time to be reset to intial value. can anyone please tell me how to do it


You can remove and add the scene or layer again.

If you take a look at the examples that comes with Cocos2d distribution, you can see that the scenes or layers are removed and replaced.

But to achieve this you have to keep all the "volatile" variables inside the layer definition, so, when you re add it again, the values will be the starting ones.

Cheers,
VFN

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜