O'Reilly logo

Cocos2d-x Game Development Essentials by Gareth Jones, Arutosh Gurung, Frahaan Hussain

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2. Adding Scenes

This chapter will guide you through the process of creating new scenes. Scenes are the different states that a game can be in, for example:

  • The Splash scene
  • The Menu scene
  • The Game scene
  • The Pause scene
  • The Game Over scene

Almost everything that is used in Cocos2d-x is a subclass of Node (part of Cocos2d-x), and scenes are no exception. Nodes provide a lot of basic features such as positioning and are used in scenes as well as in other essentials such as sprites.

All the different screens are represented as scenes within Cocos2d-x. Cocos2d-x provides the functionality to switch between scenes with built-in transitions, making the game more dynamic and vibrant.

The topics that will be covered in this chapter are as follows:

  • Creating ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required