Skip to content

class GameScene

Nikita edited this page Mar 1, 2016 · 3 revisions

#GameScene GameScene is a class that extends Scene (internal cocos class). Most of game logics is concentrated inside this class.

##Initialization At the point of initialization class gets node with level objects from LevelStorage.getLevel(int levelNumber) and creates node with UI components (new UINode()). It composes them into its own scene graph (see fig. below) and performs other needed actions to run the level (creates Player, pools for bullets, etc.).

(here will be an illustration of game scene graph)

##Destination GameScene implements main parts of gameplay controlling:

  • Collision handlers for all types of collisions
  • Victory and loss detection
  • Combos and flow control
  • Other gameplay features not implemented in cocos

Also, GameScene controls cutscenes, messageboxes (like "Game over", etc.).

Clone this wiki locally