Grid, particle, and motion streak effects

Cocos2d comes equipped with a variety of easy to use special effects. Here, we will only briefly go over all of the effects as they are fairly straightforward and are well covered in other texts.

Grid, particle, and motion streak effects

Getting ready

Please refer to the project RecipeCollection01 for full working code of this recipe.

How to do it...

To get grid effects to show up properly in your game you first need to set the EAGLView pixelFormat to kEAGLColorFormatRGBA8 (it is set to kEAGLColorFormatRGB565 by default).

Do this by going into your project file's ${PROJECT_NAME}AppDelegate.m file and changing the following code:

 EAGLView *glView = [EAGLView ...

Get Cocos2d for iPhone 1 Game Development Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.