The scene (CCLayer) where the game takes place. More...
#import <GameScene.h>
Inherits PauseDelegateProtocol-p.
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 | |
GameBackground * | background |
GameHUD * | hud |
GamePaths * | paths |
GameObjects * | objects |
TargetObjects * | targetObjects |
GameUI * | ui |
Properties | |
unsigned int | currentScore |
The scene (CCLayer) where the game takes place.
It contains all game objects, paths as well as HUD and GUI.
- (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] |
- (GameBackground*) background [protected] |
- (GameObjects*) objects [protected] |
- (TargetObjects*) targetObjects [protected] |
- (unsigned int) currentScore [read, write, assign] |