Cocos2d-x学习笔记
A. Severalimportant concepts。
Director: run backward, manage the all the scenes in the game like replacescene.
Scene: run at forward, contains several layers, control the layers,now a container of the layers.
Layer: run at forward, each layer contains several sprites, andcontrol the sprites, accept input from touching or accelerometer.
Sprite: a sprite is just a changing image.
B. Afterreading the HW code of Felix。
1.About Scene: Scene classes are used to create scenes as container of layersimplemented by creating scenes at first then creating layers of this scene andadd them to the current scene.
2.About Layer: When we init a layer we create the menu items(menu) and spritesand add them to the layer itself.
3.About the control of menu: we set a selector(a function) to carry out the event we get fromthe menu. Maybe we use Director to call its member functions to replace thescenes.
C. Timer:
We use schedule(stepfun,interval) inherited from CocosNode to run an actionrepeatly.
And we use unscheduled to release the timer.` `
D.Action.
Instant Action: Place Hide Show ToggleVisibility
Finite Time Action: Moveto MoveBy JumptoJumpby …
Composition Ation: Sequence,Spawn,Repeat, Revers, Animation, RepeatForever, Back.
E. Cocos2dx Project settings in VS2008:
First we should build the libcocos2d, because we will use the outputof the libcocos2d building in our own project, so its setting should befinished first.
Libcocos2d Project:
1. Configuration Properties ->General -> Output Directory: the result(lib files) will be built to here soit should be a place we should know.
2. Configuration Properties ->C/C++ -> General -> Additional Include Directories: here should be allthe head files’ directories that will be used by this project.
3. Configuration Properties ->Linker -> General -> Output File: $(OutDir)\$(ProjectName).dll
The OutDir is the same as the OutputDirectory in 1.
4. Configuration Properties ->Linker -> General ->Additional Library Directories: $(OutDir)
5. Configuration Properties ->Linker -> Input -> Additional Dependencies: put down all the libraries wewill use. Like : libEGL.lib libgles_cm.lib libxml2.lib libzlib.lib libpng.liblibjpeg.lib libiconv.lib pthreadVCE2.lib
My Cocos2d Project:
1. Configuration Properties ->General -> Output Directory: this should be same with the one of Libcocos2dproject.
2. Configuration Properties->