更新时间:2021-07-23 20:00:53
coverpage
Cocos2d-x by Example Beginner's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files eBooks discount offers and more
Preface
What this book covers
What you need for this book
Who this book is for
Sections
Time for action – heading
Conventions
Reader feedback
Customer support
Chapter 1. Installing Cocos2d-x
Downloading and installing Cocos2d-x
Time for action – downloading downloading downloading
Time for action – installing Cocos2d-x
Hello-x World-x
Time for action – creating an application
Time for action – deploying to Android
Finding more reference material
Time for action – running the test samples
The other tools
Summary
Chapter 2. You Plus C++ Plus Cocos2d-x
Cocos2d-x – an introduction
The class interface
Time for action – creating the interface
The class implementation
Time for action – creating the implementation
Instantiating objects and managing memory
What you get with Ref
Chapter 3. Your First Game – Air Hockey
Game configurations
Time for action – creating your game project
Time for action – laying down the rules
Supporting retina displays
Time for action – adding the image files
Time for action – adding retina support
Adding sound effects
Time for action – adding the sound files
Extending Sprite
Time for action – adding GameSprite.cpp
Time for action – implementing GameSprite
The actual game scene
Time for action – coding the GameLayer interface
Time for action – implementing init()
Time for action – handling multitouches
Time for action – adding our main loop
Time for action – updating scores
Time for action – running the game in Android
Chapter 4. Fun with Sprites – Sky Defense
The game – sky defense
Using sprite sheets in Cocos2d-x
Time for action – creating SpriteBatchNode
Bitmap fonts in Cocos2d-x
Time for action – creating bitmap font labels
Time for action – adding the final screen sprites
Time for action – creating our object pools
Actions in a nutshell
Time for action – creating actions with Cocos2d-x
Animating a sprite in Cocos2d-x
Time for action – creating animations
Time to make our game tick!
Time for action – handling touches
Time for action – starting and restarting the game
Time for action – updating the game
Time for action – retrieving objects from the pool
Play the game!
Chapter 5. On the Line – Rocket Through
The game – Rocket Through
So what are particles?
Time for action – creating particle systems
Creating the grid
Drawing primitives in Cocos2d-x
Time for action – let's do some drawing!
The rocket sprite
Time for action – updating our rocket sprite
The game loop
Time for action – adding the main loop
Kill and reset
Time for action – adding our resets and kills
Chapter 6. Quick and Easy Sprite – Victorian Rush Hour
The game – Victorian Rush Hour
The game settings
Rapid prototyping with Cocos2d-x
Time for action – creating placeholder sprites
The Player object
The Block object
The terrain object