Learning Cocos2D: A Hands-On Guide to Building iOS Games with Cocos2D, Box2D, and Chipmunk

By Rod Strougo, Ray Wenderlich

Build the subsequent nice iOS video game with Cocos2D!


Cocos2D is the powerhouse framework in the back of probably the most well known video games within the App shop. If you’ve performed Tiny Wings, indignant Birds, Mega leap, Trainyard, or maybe Super rapid motion Pig, then you’ve performed a video game that makes use of Cocos2D or Box2D physics. the wonderful thing about Cocos2D is its simplicity. It’s effortless to develop into beaten in case you begin constructing an iOS video game, particularly should you examine such things as OpenGL ES, OpenAL, and different decrease point APIs. Writing a online game for the iPhone and iPad doesn't need to be that tough, and Cocos2D makes online game improvement enjoyable and easy.


Learning Cocos2D walks you thru the method of creating Space Viking (which is loose at the App Store), a second scrolling online game that leverages Cocos2D, Box2D, and Chipmunk. As you construct Space Viking, you’ll research every thing you want to find out about Cocos2D so that you can create the following killer iOS game.


Download the loose model of Space Viking from the App shop at the present time! support Ole locate his means domestic whereas studying tips on how to construct the game.


As you construct Space Viking, you’ll find out how to


  • Install and configure Cocos2D so it really works with Xcode 4
  • Build an entire 2nd motion event online game with Cocos2D
  • Add animations and circulate in your games
  • Build your game’s major menu reveal for getting access to levels
  • Use Cocos2D’s Scheduler to ensure the ideal occasions occur on the correct times
  • Use tile maps to construct scrolling online game degrees from reusable images
  • Add audio and sound results with CocosDenshion—Cocos2D’s sound engine
  • Add gravity, sensible collisions, or even ragdoll results with Box2D and Chipmunk physics engines
  • Add notable results on your video games with particle systems
  • Leverage video game middle on your online game for achievements and chief boards
  • Squeeze the main functionality out of your video games in addition to counsel and tricks

Show description

Quick preview of Learning Cocos2D: A Hands-On Guide to Building iOS Games with Cocos2D, Box2D, and Chipmunk PDF

Similar Nonfiction books

Pearl Lowe's Vintage Craft: 50 Craft Projects and Home Styling Advice

Classic dressmaker Pearl Lowe indicates you ways to create the actual classic glance on your own residence together with her specialist suggestion and straightforward craft tasks. This functional advisor, whole with inspiring images contains . .. * 50 step by step craft initiatives * stitching, portray, upcycling and crafting secrets and techniques * A how-to consultant to sourcing your personal classic treasures * And Pearl's little black ebook of outlets and providers An absolute must-have for fanatics of classic and all issues home made.

SAP® NetWeaver Portal Technology: The Complete Reference

Your Hands-on advisor to SAP NetWeaver Portal TechnologyMaster SAP NetWeaver Portal with the main finished, step by step reference to be had at the whole portal implementation existence cycle. Written via SAP architect Rabi Jay, this e-book presents every little thing you want to plan, layout, set up, configure, and administer SAP NetWeaver Portal, together with SAP NetWeaver program Server Java.

Cloud Computing, A Practical Approach

"The promise of cloud computing is the following. those pages give you the 'eyes large open' insights you must rework your enterprise. " --Christopher Crowhurst, vice chairman, Strategic expertise, Thomson ReutersA Down-to-Earth consultant to Cloud ComputingCloud Computing: a pragmatic strategy presents a accomplished examine the rising paradigm of Internet-based company functions and companies.

Database Concepts (7th Edition)

For undergraduate database administration scholars or enterprise execs   Here’s useful support for figuring out, developing, and handling small databases—from of the world’s major database experts. Database ideas by way of David Kroenke and David Auer supplies undergraduate database administration scholars and company execs alike an organization knowing of the innovations in the back of the software program, utilizing entry 2013 to demonstrate the thoughts and strategies.

Extra resources for Learning Cocos2D: A Hands-On Guide to Building iOS Games with Cocos2D, Box2D, and Chipmunk

Show sample text content

Width * zero. 2f, zero. 0f); if ([self flipX] == convinced) { newPosition = ccp(newPosition. x * -1. 0f, zero. 0f); } movementAction = [CCJumpBy actionWithDuration:0. 5f position:newPosition height:160. 0f jumps:1]; if (isCarryingMallet) { // Viking leaping animation with the Mallet motion = [CCSequence activities: [CCAnimate actionWithAnimation:crouchingMalletAnim restoreOriginalFrame:NO], [CCSpawn activities: [CCAnimate actionWithAnimation:jumpingMalletAnim restoreOriginalFrame:YES], movementAction, nil], [CCAnimate actionWithAnimation:afterJumpingMalletAnim restoreOriginalFrame:NO], nil]; } else { // Viking leaping animation with out the Mallet motion = [CCSequence activities: [CCAnimate actionWithAnimation:crouchingAnim restoreOriginalFrame:NO], [CCSpawn activities: [CCAnimate actionWithAnimation:jumpingAnim restoreOriginalFrame:YES], movementAction, nil], [CCAnimate actionWithAnimation:afterJumpingAnim restoreOriginalFrame:NO], nil]; } holiday; case kStateAttacking: if (isCarryingMallet == definite) { ninety seven 98 bankruptcy four basic Collision Detection and the 1st Enemy motion = [CCAnimate actionWithAnimation:malletPunchAnim restoreOriginalFrame:YES]; } else { if (kLeftHook == myLastPunch) { // Execute a correct hook myLastPunch = kRightHook; motion = [CCAnimate actionWithAnimation:rightPunchAnim restoreOriginalFrame:NO]; } else { // Execute a left hook myLastPunch = kLeftHook; motion = [CCAnimate actionWithAnimation:leftPunchAnim restoreOriginalFrame:NO]; } } holiday; case kStateTakingDamage: self. characterHealth = self. characterHealth - 10. 0f; motion = [CCAnimate actionWithAnimation:phaserShockAnim restoreOriginalFrame:YES]; holiday; case kStateDead: motion = [CCAnimate actionWithAnimation:deathAnim restoreOriginalFrame:NO]; holiday; default: holiday; } if (action ! = nil) { [self runAction:action]; } } the 1st a part of the changeState procedure stops any working activities, together with animations. Any operating activities will be part of a prior kingdom of the Viking and could not be legitimate. Following the 1st line, the Viking country is determined to the hot country price, and a swap assertion is used to hold out the animations for the recent country. a couple of goods are very important to notice: Creating the Viking type 1. approach variables can't be declared inside of a swap assertion, as they'd be out of scope once the code exited the change assertion. Your identity motion variable is said above the change assertion yet initialized contained in the swap branches. 2. lots of the states have animations: one for the Viking with the Mallet and one with out. The isCarryingMallet Boolean example variable is vital in deciding on which animation to play. three. An motion in Cocos2D may be made from different activities in that it may be a compound motion. The change department taken whilst the Viking kingdom is kStateJumping has a compound motion made of CCSequence, CCAnimate, CCSpawn, and CCJumpBy activities. The CCJumpBy motion presents the parabolic circulation for Ole the Viking, whereas the CCAnimate activities play the crouching, leaping, and touchdown animations.

Download PDF sample

Rated 4.92 of 5 – based on 19 votes