Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Cocos2d-x by example (update)

You're reading from   Cocos2d-x by example (update) Unleash your inner creativity with the popular Cocos2d-x framework and learn how to build great cross-platform 2D games with this Cocos2dx tutorial

Arrow left icon
Product type Paperback
Published in Mar 2015
Publisher
ISBN-13 9781785288852
Length 270 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Roger Engelbert Roger Engelbert
Author Profile Icon Roger Engelbert
Roger Engelbert
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Installing Cocos2d-x FREE CHAPTER 2. You Plus C++ Plus Cocos2d-x 3. Your First Game – Air Hockey 4. Fun with Sprites – Sky Defense 5. On the Line – Rocket Through 6. Quick and Easy Sprite – Victorian Rush Hour 7. Adding the Looks – Victorian Rush Hour 8. Getting Physical – Box2D 9. On the Level – Eskimo 10. Introducing Lua! A. Vector Calculations with Cocos2d-x B. Pop Quiz Answers Index

Time for action – installing Cocos2d-x

Open Terminal or command prompt and navigate to the Cocos2d-x extracted folder:

  1. You can do this by typing cd (that is, cd and a space) and then dragging the folder to the Terminal window and hitting Enter. In my machine this looks like:
    cd /Applications/Dev/cocos2d-x-3.4
  2. Next, type python setup.py.
  3. Hit Enter. You will be prompted for the paths to the NDK, SDK and Apache ANT root. You must drag each one of the folders to the Terminal window, making sure to delete any extra spaces at the end of the path and hit Enter. So for the NDK I get:
    /Applications/Dev/android-ndk-r10c
  4. Next, it's the path for the SDK. Once again, I drag the folder that I have stored inside Eclipse's folder:
    /Applications/eclipse/sdk
  5. Next, it's the path to ANT. If you have it properly installed on your machine, the path will be something like usr/local/bin and the setup script will find it for you. Otherwise, you can use the one you downloaded and extracted. Just point to the bin folder inside it:
    /Applications/Dev/apache-ant-1.9.4/bin
  6. The last step is to add these paths to your system. Follow the last instruction in the window where it says: Please execute command: "source /Users/YOUR_USER_NAME/.bash_profile" to make added system variables take effect. You can copy the command inside the quotes, paste it, and hit Enter.

What just happened?

You now have Cocos2d-x installed on your machine and you're ready to go. Time to create our first project!

You have been reading a chapter from
Cocos2d-x by example (update)
Published in: Mar 2015
Publisher:
ISBN-13: 9781785288852
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime