Chapter 2. Scenes and Menus

The topics covered in this chapter are:

  • Adding a MainMenu Scene
  • Adding text using CCLabel
  • Adding buttons with CCMenu
  • Adding a Gameplay Scene
  • Transitioning between scenes
  • Adding transition effects
  • Adding a Level Selection Scene
  • Scrolling a Level Selection Scene

Introduction

In the previous chapter, we discussed how to include and manipulate sprites. In this chapter, we will take a look at how to create scenes in a game, which are used to create the basics of menus in games.

Scenes are the building blocks of any game. Generally, in any game, you have the main menu scene in which you are allowed to navigate to different scenes, such as GameScene, OptionsScene, and CreditsScene. In each of these scenes, you have menus.

Similarly, in MainScene, there is a play button that is part of a menu that, when pressed, takes the player to GameScene, where the gameplay code runs.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.85.221