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

Chapter 3. Your First Game – Air Hockey

We are going to build an Air Hockey game to introduce you to all the main aspects of building a project with Cocos2d-x. These include setting up the project's configuration, loading images, loading sounds, building a game for more than one screen resolution, and managing touch events.

Oh, and you will need to call a friend. This is a two player game. Go on, I'll wait here.

By the end of this chapter, you will know:

  • How to build an iPad-only game

  • How to enable multitouch

  • How to support both retina and non-retina displays

  • How to load images and sounds

  • How to play sound effects

  • How to create sprites

  • How to extend the Cocos2d-x Sprite class

  • How to create labels and update them

Without further ado...let's begin.