Installing Cocos2d-x 3.0 on a Mac and starting a new project.

Download the official release of Cocos2d-x 3.0. Place the unzipped archive on your system.  I use /mobile/lib for anything related to mobile development.

Set your environment PATH variable to point to the new cocos script.  Usually this would go into your “~.bash_profile”. This script will create a new project template for you.  There are no more templates to setup within Xcode.

export COCOS_CONSOLE_ROOT=/mobile/lib/cocos2d-x/tools/cocos2d-console/bin
export PATH=$COCOS_CONSOLE_ROOT:$PATH

Create a new Project

$ cocos new AirHockey -p com.andytarkinson.airhockey -l cpp -d .
Runing command: new
> Copy template into /Users/andy/projects/cocos2dx/AirHockey
> Copying cocos2d-x files...
> Rename project name from 'HelloCpp' to 'AirHockey'
> Replace the project name from 'HelloCpp' to 'AirHockey'
> Replace the project package name from 'org.cocos2dx.hellocpp' to 'com.andytarkinson.airhockey'

In case the project name AirHockey sounds familiar, I’m using the book Cocos2d-x By Example, a great book by Roger Engelbert, as a basis for forcing myself to learn about the updates in Cocos2d-x 3.0.  However please be advised that this book is not yet updated for Cocos2d-x 3.0 and therefore not recommended for learning the new release.


Comments

Installing Cocos2d-x 3.0 on a Mac and starting a new project. — 1 Comment

  1. Pingback: Compiling your Cocos2d-x 3.0 Android project on Mac

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>