g Text Version
Beauty & Self
Books & Music
Food & Wine
Health & Fitness
Hobbies & Crafts
Home & Garden
News & Politics
Religion & Spirituality
Travel & Culture
TV & Movies

Bored? Games!
Take a Quiz
Rate My Photo

Women's Fashion
Small Office/Home Office
Holiday/Seasonal Cooking
Crafts for Kids

All times in EST

Full Schedule
g Digital Art and Design Site

BellaOnline's Digital Art and Design Editor


Installing Cocos2d

Now that you have Xcode 3 installed, we can install Cocos2D which is a free, open source physics engine for Xcode. It's great for iOS apps for several reasons. It is written in Objective C and supports OpenGL ES, iPod Touch, iPhone, iPad and Mac. It supports both Box2d and Chipmunk.

I suggest that you use the same version of Cocos2D that your book is using. Like Xcode there is a lag between the most current release of Cocos2D and what you find discussed in the latest books. For Xcode 3, this will probably be cocos2d-iphone-0.99.5. Download the .tar.gz file from the Cocos2D-iPhone.org website. Click on this file and you will get an archive folder on your desktop. Open this folder and find the install-templates.sh file.

We will use the Ternimal.app to install the Cocos2D templates. Again I am assuming that you do not have any Cocos2d files install already. From your Applications folder on the Dock, go to the Utilities folder and open the Terminal.app. The first step is to tell Terminal where to find the file we want to install. After the $ in the Terminal dialog box, type "cd" and follow it with the path to the cocos2d folder. Click Return.

cd /Users/xxxxxxx/Desktop/cocos2d-iphone-0.99.5/

You should see a new line in the Terminal dialog box displaying the path to the folder. After the $, type the following to start the install.

./install-templates.sh -u.

Terminal will ask for your password. As you type in your password the cursor will not move. Don't worry, just type in your password and click Return. The installation will start and you will see a list of files. When you see "Done!" you can close the Terminal dialog box. The Cocos2D files are install.

Let's open Xcode and start a new project to see if we have Cocos2D installed. In the New Project dialog box you will see a new tab called User Templates in the left menu. Under this tab we see the Cocos2d 0.99.5 is listed. In the right panel, we have several icons.

  • cocos2d Application - template for cocos2d for iOS
  • cocos2d Application - Mac - template for cocos2d for Mac
  • cocos2d Box2d Application - cocos2d iOS and Box2d
  • cocos2d Chipmunk Application - cocos2d iOS and Chipmunk
As you can see, we can use three of these templates for iOS projects. The first is a generic project template and the other two have the basic supporting files for the Box2d and Chipmunk physics engines.

Let's test the cocos2d-Application template. Choose this template and Click Choose. The new project will display in the Xcode workspace and you should see a few new folders for this project. From the Simulator drop-down menu, choose iPad Simulator 4.2 not 4.3. Click the Build and Run button.

You can delete the cocos2d-iphone-0.99.5 folder and tar.gz files from your desktop.

Join us in the Flash forum. | Join us in the Digital Art and Design forum.

Add Installing+Cocos2d to Twitter Add Installing+Cocos2d to Facebook Add Installing+Cocos2d to MySpace Add Installing+Cocos2d to Del.icio.us Digg Installing+Cocos2d Add Installing+Cocos2d to Yahoo My Web Add Installing+Cocos2d to Google Bookmarks Add Installing+Cocos2d to Stumbleupon Add Installing+Cocos2d to Reddit


RSS | Related Articles | Editor's Picks Articles | Top Ten Articles | Previous Features | Site Map

For FREE email updates, subscribe to the Digital Art and Design Newsletter

Past Issues

Printer Friendly
tell friend
Tell a Friend
Email Editor

Content copyright © 2015 by Diane Cipollo. All rights reserved.
This content was written by Diane Cipollo. If you wish to use this content in any manner, you need written permission. Contact Diane Cipollo for details.


g features
iBooks Author Quick Answers

iBooks Author Resource List

iBA Template - Story Page Layouts

Archives | Site Map


Past Issues

Less than Monthly

BellaOnline on Facebook

| About BellaOnline | Privacy Policy | Advertising | Become an Editor |
Website copyright © 2015 Minerva WebWorks LLC. All rights reserved.

BellaOnline Editor