Public Member Functions | Static Public Member Functions | Protected Attributes | Properties

GameScene Class Reference

The scene (CCLayer) where the game takes place. More...

#import <GameScene.h>

Inherits PauseDelegateProtocol-p.

Collaboration diagram for GameScene:
Collaboration graph
[legend]

List of all members.

Public Member Functions

(id) - init
 should not be called by you - use [GameScene scene] instead!
(bool) - isPlaying
 returns true if the game is running, false if it is paused either because of the pause menu being shown or the game being over
(void) - onPauseGame
 pauses the game, also called when AppDelegate receives incoming call etc.
(void) - onResumeGame
 resumes the game when it is paused, otherwise does nothing
(void) - onCrash
 pauses the scene for a moment, then resets
(void) - dealloc [implementation]
(void) - registerWithTouchDispatcher [implementation]
 We want to use a targeted touch dispatcher because then we don't need to deal with the user drawing a path and moving over a UI button by accident.
(BOOL) - ccTouchBegan:withEvent: [implementation]
(void) - ccTouchMoved:withEvent: [implementation]
(void) - ccTouchEnded:withEvent: [implementation]
(void) - ccTouchCancelled:withEvent: [implementation]
(void) - setIsPlaying: [implementation]
(void) - setIsPaused: [implementation]
(void) - onCrashTimeOut: [implementation]
(void) - onPauseButton:

Static Public Member Functions

(id) + scene
 creates the scene, returns an autoreleased object
(GameScene *) + instance
 instance of GameScene, only valid as long as the scene is running (caution: it's not a proper Singleton!).

Protected Attributes

GameBackgroundbackground
GameHUDhud
GamePathspaths
GameObjectsobjects
TargetObjectstargetObjects
GameUIui

Properties

unsigned int currentScore

Detailed Description

The scene (CCLayer) where the game takes place.

It contains all game objects, paths as well as HUD and GUI.


Member Function Documentation

- (BOOL) ccTouchBegan: (UITouch*)  touch
withEvent: (UIEvent*)  event 
[implementation]
- (void) ccTouchCancelled: (UITouch*)  touch
withEvent: (UIEvent*)  event 
[implementation]
- (void) ccTouchEnded: (UITouch*)  touch
withEvent: (UIEvent*)  event 
[implementation]
- (void) ccTouchMoved: (UITouch*)  touch
withEvent: (UIEvent*)  event 
[implementation]
- (void) dealloc   [implementation]
- (id) init  

should not be called by you - use [GameScene scene] instead!

+ (GameScene *) instance  

instance of GameScene, only valid as long as the scene is running (caution: it's not a proper Singleton!).

It's meant for quick access to it from child nodes.

- (bool) isPlaying  

returns true if the game is running, false if it is paused either because of the pause menu being shown or the game being over

- (void) onCrash  

pauses the scene for a moment, then resets

- (void) onCrashTimeOut: (ccTime)  delta   [implementation]
- (void) onPauseButton: (id)  sender  
- (void) onPauseGame  

pauses the game, also called when AppDelegate receives incoming call etc.

Reimplemented from <PauseDelegateProtocol>.

- (void) onResumeGame  

resumes the game when it is paused, otherwise does nothing

- (void) registerWithTouchDispatcher   [implementation]

We want to use a targeted touch dispatcher because then we don't need to deal with the user drawing a path and moving over a UI button by accident.

Using a Targeted touch handler avoids the button being "touched" accidentally.

+ (id) scene  

creates the scene, returns an autoreleased object

- (void) setIsPaused: (bool)  isPaused   [implementation]
- (void) setIsPlaying: (bool)  isPlaying   [implementation]

Member Data Documentation

- (GameBackground*) background [protected]
- (GameHUD*) hud [protected]
- (GameObjects*) objects [protected]
- (GamePaths*) paths [protected]
- (TargetObjects*) targetObjects [protected]
- (GameUI*) ui [protected]

Property Documentation

- (unsigned int) currentScore [read, write, assign]

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Enumerations Enumerator Properties