售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Building Android Games with Cocos2d-x
Table of Contents
Building Android Games with Cocos2d-x
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Setting Up Your Development Environment
Cocos2d-x overview
Setting up Java
Setting up the Android SDK
Downloading the Android SDK
Downloading Eclipse
Setting up the Eclipse ADT plugin
Setting up the Android Native Development Kit
Setting up Apache Ant
Setting up Python
Setting up Cocos2d-x
Creating your first project
Setting up the Eclipse IDE
Template code walk-through
Java classes
Android application configuration
C++ classes
Scenes
Summary
2. Graphics
Creating scenes
Understanding Layers
Using the director
Pausing the game
Organizing our resources files
Creating our pause scene header file
Creating the pause scene implementation file
Transitions
Understanding nodes
Understanding sprites
Creating sprites
Positioning sprites
Setting anchor points
Understanding the Cocos2d-x coordinate system
Adding sprites to the scene
Positioning sprites outside the visible area
Positioning the player sprite
Understanding actions
Moving sprites
Creating sequences
Animating sprites
Improving performance with sprite sheets
Game menus
Handling multiple screen resolutions
Putting everything together
Summary
3. Understanding Game Physics
Setting up the physics world
Collision detection
Handling gravity
Handling physics properties
Applying velocity
Linear damping
Applying force
Applying impulse
Applying torque
Putting everything together
Summary
4. User Input
Understanding the Event Dispatcher mechanism
Handling the touch event
Handling multi-touch events
Handling accelerometer events
Keeping the screen alive
Handling the Android back key pressed event
Putting everything together
Summary
5. Handling Text and Fonts
Creating TrueType font labels
Creating our GameOverScene
Calling our GameOverScene when a player loses
Customizing the GameOverScene
Adding label effects
Creating system fonts
Creating bitmap font labels
Adding more bombs to our game
Putting everything together
Summary
6. Audio
Playing background music and sound effects
Modifying audio properties
Handling audio when leaving the game
The new audio engine
New features included in the new audio engine
Adding a mute button to our game
Putting everything together
Summary
7. Creating Particle Systems
Creating collections of the Cocos2d-x objects
Exploding bombs
Adding particle systems to our game
Configuring the particle systems
Creating customized particle systems
Putting everything together
Summary
8. Adding Native Java Code
Understanding the Cocos2d-x structure for the Android platform
Understanding the JNI capabilities
Adding Java code to the Cocos2d-x game
Adding ads to the game by inserting Java code
Configuring the environment
Modifying the Android manifest
Adding the Java code
Putting everything together
Summary
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜