Free Sample
+ Collection

Cocos2d-x Game Development Essentials

Frahaan Hussain, Arutosh Gurung, Gareth Jones

Create iOS and Android games from scratch using Cocos2d-x.
RRP $13.99
RRP $22.99
Print + eBook

Want this title & more?

$12.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781783987863
Paperback136 pages

About This Book

  • Create and run Cocos2d-x projects on iOS and Android platforms.
  • Find practical solutions to many real-world game development problems.
  • Learn the essentials of Cocos2d-x by writing code and following step-by-step instructions.

Who This Book Is For

This book is designed to help existing developers who are looking to learn this amazing framework, which provides cross-platform development. It is also perfect for developers who already have an existing C++ foundation and would like to learn game development using Cocos2d-x, or those who are coming from another framework.

Table of Contents

Chapter 1: Setting Up
What is Cocos2d-x?
Setting up the project
Implementing multiresolution support
Chapter 2: Adding Scenes
Creating new scenes
Manipulating scenes
Chapter 3: Adding Game Menus
Setting up the menu
Coding the menus in the Main Menu scene
Coding the menus in the Game scene
Coding the menus in the Pause scene
Coding the menus in the Game Over scene
Chapter 4: Scene Transitions
The fade transition
Additional transitions
Chapter 5: The Game Sprites
Adding the Main Menu sprites
Adding the Game Over sprites
Adding the Pause sprites
Adding the Game sprites
Chapter 6: Implementing Actions
Chapter 7: Moving the Space Pod Using Touch
The general process for setting up touches
Single-touch events
Multi-touch events
Chapter 8: Collision Detection
Collision detection
Player collision detection
Chapter 9: Adding Audio to the Game
Loading and playing sound effects
Adding sound effects
Loading and playing background music
Chapter 10: Implementing Accelerometer Support
Setting up the accelerometer
Chapter 11: Problem Solving and What's Next
Problem solving
What's next?

What You Will Learn

  • Set up Cocos2d-x to create games
  • Create a new project in Cocos2d-x
  • Learn to run a project on iOS and Android platforms
  • Implement the core game structure using Cocos2d-x tools and techniques
  • Add gameplay using general coding practices and built-in functions within Cocos2d-x
  • Manipulate the game items to provide gameplay using Cocos2d-x actions
  • Overcome common problems faced during the game development phase with Cocos2d-x

In Detail

Cocos2d-x is the C++ port of the most popular open source 2D framework in the world. Cocos2d-x is an amazing open source game engine that allows developers to exploit their existing C++, Lua, and JavaScript knowledge for cross-platform deployment into iOS, Android, Windows Phone, BlackBerry, Tizen, and HTML5, saving you time, effort, and cost.

You will learn the essentials of Cocos2d-x through examples, by creating a game from scratch. The book starts with adding scenes and menus to the game. Furthermore, you can learn more about the varied features such as scene transitions, game sprites, moving the spaceship, and adding audio to make your game livelier. By the end of the book, you will be able to solve problems that may arise during the entire game development phase.


Read More