In this new regular series of tutorials i will show you how to create games for Mac OS X and iOS.I will cover Xcode, Objective-C and the cocos2d framework. I will not cover everything down to the basics so you should have some understanding of programming in general.
What you need
Stable
Mac OS X Snow Leopard
Xcode 4.0
cocos2d 1.0
Bleeding Edge
Mac OS X Lion (dp)
Xcode 4.1 (dp)
checkout latest cocos2d sources via git
git clone git://github.com/cocos2d/cocos2d-iphone.git
cd cocos2d-iphone
git checkout develop
System Setup
Install Xcode 4
Install cocos2d Xcode 4 templates
cd Downloads
tar -zxvf cocos2d-iphone-1.0.0-rc.tar.gz
cd cocos2d-iphone-1.0.0-rc
sudo sh install-templates.sh
Project Setup
Start Xcode and start a new Project.
You will now see your project in the Xcode workspace.
Project Setup
As template choose "chipmunk" from the cocos2d category.
Chipmunk is one of the 2 built in physic engines in cocos2d. I choose this instead of "box2d" cause it's faster and not written in (obj)c++.
You can also create a simple cocos2d project without any physics engine.
Next you must choose a name for the game, we go with "TestGame" in this tutorial. When asked where to save the project i recommend you make a new directory dedicated to this tutorials. Make sure to select "create local git repository for this project" it will allow you to use snapshots and versioning. We will cover git later in more detail.
You can start your game by pressing the play button in the upper left corner.
This will start the application in the iPhone simulator (default iOS on iPhone4)
Gratulation, we a have a working iOS game. In the next part we will look at some of the Objective-C concepts and start to implement a real game.





35 comments:
this is so cool! thx man :)
Does this work for pc too? I think I've read that these tools are not available
@Flodström
sorry, xcode is only available for os x
My girlfriend is getting into this business, will show her this! Great post!
Look's pretty cool!
Awesome tutorial, I love doing stuff like this in my free time.
that sounds awsome, haven't messed around with xcode for a while
cool thanks
Though I can't follow the instructions (not having regular enough access to a Mac), I will be following the series. Always helps to learn something new like this.
Hm.. I don't usually use a Mac, but I'm always about learning new computer related things. Even though I've never truly been a fan of Macs, however.
this would be cool if i had a mac ;_;
so much git
Thank you for this!
i have no understanding of programming but this is cool of you to do
my mind.
Good stuff!
Have you made anything using these tools?
wish I didn't have to have a mac to program for iOS.
@trelin exactly xD
Anyways a nice guide
i always sorta wanted to learn to code, but not everything that goes with it
cant wait for more tuts!
That is insane, make your own games?
I am really looking forward to seeing more of your tutorials soon!
This is an awesome tool!
I hear it's very profitable to make apps for the store... hmm...
I'm liking this! keep up the good work!
Useful stuff mate, cheers
so much coolll
This all sounds way too confusing for me, I hope it helps someone though!
Good info. I think I'll make a game like Mad Birds or something. :p
This is way too technical for me, but I'm glad others are getting a lot out of this post!
cool app!
nice app!
When I finally get a MacBook Pro, I'm making some apps ASAP.
Thanks for the thorough game programming explanation. Mobile applications and games are a huge trend for developers right now and are equally popular in the marketplace. Your simple but complete instructions for the iOS and Mac OSX are very helpful.
Post a Comment