Creating Games with cocos2d for iPhone 2 by Paul Nygard

By Paul Nygard

Master cocos2d via construction 9 entire video games for the iPhone


  • Games are defined intimately, from the layout judgements to the code itself.
  • Learn to construct a large choice of online game forms, from a reminiscence tile video game to an never-ending runner.
  • Use diversified layout methods that will help you discover the cocos2d framework.

In Detail

Cocos2d for iPhone is a straightforward (but strong) 2nd framework that makes it effortless to create video games for the iPhone. there are literally thousands of video games within the App shop already utilizing cocos2d. online game improvement hasn't ever been this approachable and straightforward to get started.

"Creating video games with cocos2d for iPhone 2" takes you thru the complete strategy of designing and development 9 whole video games for the iPhone, iPod contact, or iPad utilizing cocos2d 2.0. The tasks begin easily and progressively bring up in complexity, development at the classes realized in earlier chapters. solid layout practices are emphasised throughout.

From an easy fit online game to an unending runner, you are going to the best way to construct a large choice of video game styles.

You will easy methods to enforce animation, activities, create “artificial randomness”, use the Box2D physics engine, create tile maps, or even use Bluetooth to play among devices.

"Creating video games with cocos2d for iPhone 2" will take your video game development talents to the following point.

What you are going to research from this book

  • Control sprites with contact, joysticks, and tilt controls.
  • Use sprite sheets, debris, and plists effectively.
  • Learn a number of ways to unravel universal challenges.
  • Integrate cocos2d with the Box2D physics engine.
  • Use third-party courses for joystick regulate, tile maps, and more.
  • Implement Bluetooth to play throughout a number of devices.
  • Learn game-specific A.I. layout methodologies.


There are 9 whole video games with expanding complexity inbuilt this ebook. the method of online game construction is well-illustrated with screenshots and defined code.

Who this publication is written for

This publication is aimed toward readers with an figuring out of Objective-C and a few familiarity with the cocos2d for iPhone 2.0 framework.

Show description

Read Online or Download Creating Games with cocos2d for iPhone 2 PDF

Best games & strategy guides books

Game Scripting Mastery

I obtained my buy in virtually excellent . The CD that got here with the ebook had a scratch on it that just about made it unusable, yet I controlled to get every little thing i wished off of it (Direct X was once the single factor that would not set up thoroughly, that you could get somewhere else, so I acquired fortunate. it may were worse, notwithstanding.

Well Played 1.0: Video Games, Value and Meaning

Games may be "well performed" in senses. at the one hand, good performed is to video games in addition learn is to books. nonetheless, good performed as in good performed. This booklet is stuffed with in-depth shut readings of games that parse out many of the meanings to be present in the adventure of taking part in a online game.

Vintage Game Consoles: An Inside Look at Apple, Atari, Commodore, Nintendo, and the Greatest Gaming Platforms of All Time

Classic video game Consoles tells the tale of the main influential videogame structures of all time, together with the Apple II, Commodore sixty four, Nintendo leisure procedure, online game Boy, Sega Genesis, Sony PlayStation, and lots of extra. It uncovers the main points in the back of the consoles, desktops, handhelds, and arcade machines that made videogames attainable.

Additional resources for Creating Games with cocos2d for iPhone 2

Sample text

We also set the tileSize value here, based on an even spacing of the tiles, along with the extra pad space we will be using between the tiles. Because we need square tiles, there is also the additional check to force the tiles to be square if the source images are not. This will distort the images, but it won't disrupt the game mechanics. Additionally, the boardOffsetX and boardOffsetY variables simply ensure the board will be nicely centered in the available board space. The flow of the game We will need several arrays in the game to help track the tiles.

If we skipped the delay, the checkForMatch method would cause this mutation (and crash) because it can remove tiles from the tilesInPlay array. Go ahead and try it yourself. Actually seeing the error messages when you know what you did wrong will help you know where to look later, when you cause a crash without knowing what you did wrong. Checking for matches Since we have done quite a bit of preparation for the rest of the mechanics of the game, it might come as a surprise that the logic to check for matching tiles is very simple.

5]; CCCallFuncND *remove = [CCCallFuncND actionWithTarget:self selector:@selector(removeMemoryTile:) data:aTile]; // Run the actions [aTile runAction:[CCSequence actions:move, scale, delay, remove, nil]]; // Play the sound effect [[SimpleAudioEngine sharedEngine] playEffect:SND_TILE_SCORE]; // Remove the tile from the tilesInPlay array [tilesInPlay removeObject:aTile]; // Add 1 to the player's score playerScore++; // Recalculate the number of lives left [self calculateLivesRemaining]; } Here we leverage the cocos2d actions heavily, using the stock actions of CCMoveTo, CCScaleTo, CCDelayTime, and CCCallFuncND.

Download PDF sample

Rated 4.14 of 5 – based on 15 votes