diff options
Diffstat (limited to 'Classes/GameMode.m')
| -rw-r--r-- | Classes/GameMode.m | 24 |
1 files changed, 10 insertions, 14 deletions
| diff --git a/Classes/GameMode.m b/Classes/GameMode.m index e45ddfe..49d0053 100644 --- a/Classes/GameMode.m +++ b/Classes/GameMode.m | |||
| @@ -14,19 +14,6 @@ | |||
| 14 | 14 | ||
| 15 | @synthesize cart, score, lives, isPaused, pointMultiplier; | 15 | @synthesize cart, score, lives, isPaused, pointMultiplier; |
| 16 | 16 | ||
| 17 | + (CCScene*)scene | ||
| 18 | { | ||
| 19 | CCScene* scene = [CCScene node]; | ||
| 20 | |||
| 21 | GameMode* layer = [self node]; | ||
| 22 | layer.tag = GAME_LAYER; | ||
| 23 | [scene addChild:layer]; | ||
| 24 | |||
| 25 | scene.tag = GAME_SCENE; | ||
| 26 | |||
| 27 | return scene; | ||
| 28 | } | ||
| 29 | |||
| 30 | - (id)init | 17 | - (id)init |
| 31 | { | 18 | { |
| 32 | self = [super init]; | 19 | self = [super init]; |
| @@ -52,6 +39,8 @@ | |||
| 52 | score = 0; | 39 | score = 0; |
| 53 | lives = 3; | 40 | lives = 3; |
| 54 | pointMultiplier = 1; | 41 | pointMultiplier = 1; |
| 42 | |||
| 43 | objectFactory = [[FallingObjectFactory alloc] init]; | ||
| 55 | 44 | ||
| 56 | if ([self canPause]) | 45 | if ([self canPause]) |
| 57 | { | 46 | { |
| @@ -259,10 +248,17 @@ | |||
| 259 | } | 248 | } |
| 260 | } | 249 | } |
| 261 | 250 | ||
| 251 | + (GameModeInfo*)info | ||
| 252 | { | ||
| 253 | [NSException raise:@"Unimplemented method" format:@"Method -info of GameMode subclasses must be overridden"]; | ||
| 254 | |||
| 255 | return nil; | ||
| 256 | } | ||
| 257 | |||
| 262 | - (void)setPitch:(double)m_pitch | 258 | - (void)setPitch:(double)m_pitch |
| 263 | { | 259 | { |
| 264 | pitch = m_pitch; | 260 | pitch = m_pitch; |
| 265 | 261 | ||
| 266 | [cart deviceDidRotate:pitch]; | 262 | [cart deviceDidRotate:pitch]; |
| 267 | } | 263 | } |
| 268 | 264 | ||
