Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
433 views
in Technique[技术] by (71.8m points)

ios - Adding Cocos2D only to already existing project?

I already have a project that is 90% done and I want to add Cocos2D ONLY to it. I do not need Box2D or Chipmunk. How would I do this? What files do I add? I really need this done, so in the end ill offer a bounty if needed.

Thanks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

To start the easier way to add Cocos2d into your project is to follow these lines:

  1. Import the Cocos2d files into your project like the picture below: Copy the Cocos2d file into the project

  2. Then import the "FontLabel" folder which is located into the "external" folder (Into the Cocos2d library) like the previous step.

  3. After, you have to link the OpenGLES and QuartzCore frameworks with your project: enter image description here

  4. Next in the "Project navigator", select your target and open the “Build Settings” tab.

  5. Add the -lz flag into the "Other Linker Flags": enter image description here

That's all! No it should compile properly.

However I don't if you want to use Cocos2d with the UIKit framework or if you want use it as the main entry. If you want more details about these steps you can check the Ray Wenderlich blog's post.

I hope it'll help you.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...