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 – running the test samples

You can open the test project just like you would any other Xcode/Eclipse project:

  1. In Eclipse, you can import the test project from inside the Cocos2d-x folder you downloaded. You'll find it in tests/cpp-tests/proj.android.
  2. You can follow the same steps as before to build this project.
  3. In Xcode, you must open the tests project file that you'll find in the Cocos2d-x framework folder inside the build folder: build/cocos2d_tests.xcodeproj.
  4. Once the project is opened in Xcode, you must select the correct target next to the Run button as follows:
    Time for action – running the test samples
  5. In order to actually review the code inside the tests, you may navigate to tests/cpp-tests/Classes for the C++ tests or tests/lua-tests/src for the Lua tests. Better yet, if you have a program such as TextWrangler or an equivalent, you can open these entire directories inside a Disk Browser window and have all that information ready for referencing right at your desktop.

What just happened?

With the test samples, you can visualize most features in Cocos2d-x, what they do, as well as see some of the ways you can initialize and customize them.

I will refer to the code found in the tests quite often. As usual with programming, there is always a different way to accomplish the same task, so sometimes, after showing you one way, I'll refer to a different one that you can find (and by then easily understand) inside the Test classes.

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