Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add Cocos2D to project in xCode 4

I'm working in a project that need to have same parts native (cocoa touch) and some parts in cocos2d. I have made the all the native and now I need to integrate cocos2d in the project. My problem is that i cant add with success the cocos2d library to my project. Any good solution to do that? I'm using xCode 4

like image 230
António Avatar asked Apr 18 '11 10:04

António


1 Answers

You essentially have two choices.

Option 1: Add cocos2d files to your existing project

  1. Add cocos2d files to your project as normal (drag the source files in, copy to dest folder).
  2. Create an EAGLView in a View Controller and bind it to the CCDirector. (See an example project for reference.

Option 2: Install your existing code into a fresh project using the cocos2d templates

The latest version of cocos2d (1.0-RC) has XCode 4 templates. Install them:

install-templates.sh --force

Then create a new cocos2d project using those templates in XCode 4. Add your existing files and update the project that it creates, and you should be good to go.

Personally, I've had better luck with Option #2, but most of my code is pretty easy to move around.

like image 104
asinesio Avatar answered Oct 05 '22 06:10

asinesio