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:
- Background Layer (static content)
- Objects Layer (For everything that moves)
- HUD Layer (Heads up display for the buttons and stuff)
精彩评论