开发者

Cocos2d 1.0.0 Differences between past versions

Ok so got a book today written by Steffen Itterheim and stright away my template files look different to what they are in the book. HelloWorldScene.mm vs HelloWorldLayer.mm what is the difference, even the code inside looks different.

Am i right in thinking every scene can have many layers. So the thing I am strugglin开发者_Python百科g with is how come layers now have their own class files.


I used Cocos2d on its 0.8 version, I am pretty sure it has changed a lot, however it has always been the case that an scene can have as many layers as you want, and yes it is recommended you use a file for each layer this makes your code easier to mantain.

You will for example have in your scene usually at least this 3 layers per scene:

  1. Background Layer (static content)
  2. Objects Layer (For everything that moves)
  3. HUD Layer (Heads up display for the buttons and stuff)
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜