Cocos2D Key Features

Still unsure if Cocos2D is right for you? Well, check out some of these amazing fea-
tures of Cocos2D that can make developing your next game a lot easier.
Actions
Actions are one of the most powerful features in Cocos2D. Actions allow you to move, scale, and manipulate sprites and other objects with ease. As an example, to
smoothly move a space cargo ship across the screen 400 pixels to the right in 5 seconds, all the code you need is:
       CCAction *moveAction = [CCMoveBy actionWithDuration:5.0f
                                          position:CGPointMake(400.0f,0.0f)];
       [spaceCargoShipSprite runAction:moveAction];
 That’s it; just two lines of code! Figure P.1 illustrates the moveAction on the space cargo ship.
There are many kinds of built-in actions in Cocos2D: rotate, scale, jump, blink, fade, tint, animation, and more. You can also chain actions together and call custom callbacks for neat effects with very little code.


Built-In Font Support
Cocos2D makes it very easy to deal with text, which is important for games in menu systems, score displays, debugging, and more. Cocos2D includes support for embedded TrueType fonts and also a fast bitmap font-rendering system, so you can display text to the screen with just a few lines of code.


An Extensive Effects Library

Cocos2D includes a powerful particle system that makes it easy to add cool effects such as smoke, fire, rain, and snow to your games. Also, Cocos2D includes built-in effects,  such as f lip and fading, to transition between screens in your game.


Great for TileMap Games

Cocos2D includes built-in support for tile-mapped games, which is great when you have a large game world made up of small reusable images. Cocos2D also makes it easy to move the camera around to implement scrolling backgrounds or levels. Finally,  there is support for parallax scrolling, which gives your game the illusion of 3D depth and perspective.


Audio/Sound Support
The sound engine included with Cocos2D allows for easy use of the power of OpenAL without having to dive into the lower level APIs. With Cocos2D’s sound engine, you can play background music or sound effects with just a single line of code!


 Two Powerful Physics Engines

 Also bundled with Cocos2D are two powerful physics engines, Box2D and Chipmunk,  both of which are fantastic for games. You can add a whole new level of realism to  your games and create entire new gameplay types by using game physics—without  having to be a math guru.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值