![]() Open the Work with combo box and select the item containing your Eclipse version name ( Juno if using the last version of Eclipse).From the Eclipse IDE main toolbar, go to Help/Install New Software.Open up Eclipse and perform the following steps: This includes some plugins for C/C development! Let’s install them now. If you don’t, follow through the Getting Started With Android Development tutorial first, which provides a step-by-step guide to setting up a dedicated Eclipse Android development platform.īut wait… A standard Eclipse Android environment is dedicated to Java development only, and Cocos2D-X is based on C !ĭon’t worry, Eclipse has been around for 10 years, so there are tons of plugins out there to extend its core functionality beyond just Java development. This Cocos2D-X tutorial assumes that you have a fully-functional Android Eclipse standard development environment. You’re now done with the Xcode setup part and you need to have a look at the Android Cocos2D-X configuration with Eclipse. If you’re familiar with Cocos2D, this should look familiar to you – the same Cocos2D API, but in C ! Setting up Eclipse for Cocos2D-X Development Pretty easy, eh? While you’re at it, take a look at the project files in Xcode – particularly Classes\HelloWorldScene.h and Classes\HelloWorldScene.cpp. Now press the Run button to see the Cocos2d-x Hello World app running: Let’s try the new templates out! Open up Xcode (4.6 if using the last version) and create a new project, selecting the iOS\cocos2d-x\cocos2dx template:Ĭlick Next, name the project Cocos2DxFirstIosSample, choose iPhone for Device Family, click Next and then click Create. ![]() Don’t worry, the Cocos2d-X templates don’t conflict with the classic Cocos2D templates, so you can continue to create new projects using Cocos2D, when needed. You should see a new Cocos2d-x temples section in the project template dialog. Once the templates are installed, run Xcode and create a New Project. The installation will simply proceed without any further intervention from you. Simply typing in $COCOS2DX_HOME as part of the command will do nothing. Note: In the above, for the first line, you need to replace $COCOS2DX_HOME with the actual path to where you extracted the files. ![]() To run it, just quit Xcode, open a shell terminal and type: Now that you’ve got the code, let’s install the templates! You can do this with a script that’s inside $COCOS2DX_HOME. Note the full path to that folder – it will be referred as $COCOS2DX_HOME. Unzip the file in to a folder somewhere on your hard drive. ![]() ![]() So grab your iPhone and/or Android device, and let’s get started! Hello, Cocos2D-X for iOS!īefore you go any further, make sure you download the latest version of Cocos2D-X. In this Cocos2D-X tutorial, you’ll learn how to use Cocos2D-X and C to produce a cross-platform “Hello World” app that will run under both iOS and Android.Īnd in a few days, I’ll post a follow-up Cocos2D-X tutorial that will show you a practical game example – a cross platform space shooter! And since it’s in C , it works on many platforms – from iOS to Android to Windows to Linux and more! Well, this is possible with the Cocos2D-X game framework! Cocos2D-X is a C port of the Cocos2D API, so you can use the API you know and love. Wouldn’t it be great if you could use the same easy to use Cocos2D API, but have it run on Android as well? This way you could greatly extend the market for your app, without adding a lot of extra work! (original post by Jean-Yves Mengant, update by Jorge Jordán).Ĭocos2D is an amazing and easy to use framework, but since it’s written in Objective-C you can only write games with it for iOS and the Mac. Update Fully updated for Cocos2D-X 2.1 and iOS 6. ![]()
0 Comments
Leave a Reply. |