Book Image

Cocos2d-x by Example: Beginner's Guide

By : Roger Engelbert
Book Image

Cocos2d-x by Example: Beginner's Guide

By: Roger Engelbert

Overview of this book

Table of Contents (19 chapters)
Cocos2d-x by Example Beginner's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – running the game in Android


Time to deploy the game to Android.

  1. Navigate to the proj.android folder and open the file AndroidManifest.xml in a text editor. Then go to the folder jni and open the file Android.mk in a text editor.

  2. In the AndroidManifest.xml file, edit the following line in the activity tag as follows:

    android:screenOrientation="portrait"   
  3. Next, let's edit the make file, so open the Android.mk file and edit the lines in LOCAL_SRC_FILES to read:

    LOCAL_SRC_FILES := hellocpp/main.cpp \
                       ../../Classes/AppDelegate.cpp \
                       ../../Classes/b2Sprite.cpp \
                       ../../Classes/Eskimo.cpp \
                       ../../Classes/GSwitch.cpp \
                       ../../Classes/Igloo.cpp \
                       ../../Classes/Platform.cpp \
                       ../../Classes/LevelSelectLayer.cpp \
                       ../../Classes/MenuLayer.cpp \
                       ../../Classes/GameLayer.cpp
  4. Now import the project into Eclipse and build it...