Cocos2d-x学习笔记

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: SequenceSpawnRepeat, 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->

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值