We have added physics to our game by creating a physics world and physics bodies that represent the bomb and our player sprite, and we have used the collision detection mechanism provided by the built-in physics engine in a very few steps. We have also showed how to change the gravity parameters so that the physic bodies move according to the force of gravity. We have easily changed the physics properties of the bodies, such as velocity, friction, force, impulse, and torque with a single line of code for each of those. So far, our player ignores our user events. In the next chapter, we will cover how to add user interaction to our game.
Building Android Games with Cocos2d-x
By :
Building Android Games with Cocos2d-x
By:
Overview of this book
Table of Contents (16 chapters)
Building Android Games with Cocos2d-x
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
Setting Up Your Development Environment
Graphics
Understanding Game Physics
User Input
Handling Text and Fonts
Audio
Creating Particle Systems
Adding Native Java Code
Index
Customer Reviews