summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--Classes/TutorialMode.m45
1 files changed, 31 insertions, 14 deletions
diff --git a/Classes/TutorialMode.m b/Classes/TutorialMode.m index ed51648..1ada34a 100644 --- a/Classes/TutorialMode.m +++ b/Classes/TutorialMode.m
@@ -20,6 +20,7 @@
20// 2002 - items that are dropped after you miss first dropped item to demonstrate what happens when you catch 20// 2002 - items that are dropped after you miss first dropped item to demonstrate what happens when you catch
21// 2003 - 1-Up 21// 2003 - 1-Up
22// 2009 - rock 22// 2009 - rock
23// 2010 - random item dropped after death from first rock
23 24
24@implementation TutorialMode 25@implementation TutorialMode
25 26
@@ -122,10 +123,33 @@
122 [self schedule:@selector(randomlyAddObject:) interval:2.5f]; 123 [self schedule:@selector(randomlyAddObject:) interval:2.5f];
123 } else if (item.sprite.tag == 2009) 124 } else if (item.sprite.tag == 2009)
124 { 125 {
126 if ((lives < 1) && (!showedDeathBubble))
127 {
128 showedDeathBubble = YES;
129
130 TutorialBubble* bubble = [[TutorialBubble alloc] initWithText:@"You lost all your lives! Normally, you'd be taken to a game over screen where you could submit your score to the highscore list, but we're a bit more forgiving in tutorial mode." name:@"gameover-rock"];
131 self.currentTutorial = bubble;
132 [bubble release];
133 } else {
134 TutorialBubble* bubble = [[TutorialBubble alloc] initWithText:@"As you play, Cart Collect gets progressively more intense. Watch what happens when rocks are added to the mix and the speed is turned up." name:@"intense"];
135 self.currentTutorial = bubble;
136 [bubble release];
137 }
138 } else if (item.sprite.tag == 2010)
139 {
125 TutorialBubble* bubble = [[TutorialBubble alloc] initWithText:@"As you play, Cart Collect gets progressively more intense. Watch what happens when rocks are added to the mix and the speed is turned up." name:@"intense"]; 140 TutorialBubble* bubble = [[TutorialBubble alloc] initWithText:@"As you play, Cart Collect gets progressively more intense. Watch what happens when rocks are added to the mix and the speed is turned up." name:@"intense"];
126 self.currentTutorial = bubble; 141 self.currentTutorial = bubble;
127 [bubble release]; 142 [bubble release];
128 } 143 }
144
145 if ((lives < 1) && (!showedDeathBubble))
146 {
147 showedDeathBubble = YES;
148
149 TutorialBubble* bubble = [[TutorialBubble alloc] initWithText:@"You lost all your lives! Normally, you'd be taken to a game over screen where you could submit your score to the highscore list, but we're a bit more forgiving in tutorial mode." name:@"gameover"];
150 self.currentTutorial = bubble;
151 [bubble release];
152 }
129} 153}
130 154
131- (void)setCurrentTutorial:(TutorialBubble *)m_currentTutorial 155- (void)setCurrentTutorial:(TutorialBubble *)m_currentTutorial
@@ -191,6 +215,13 @@
191 object.sprite.tag = 2003; 215 object.sprite.tag = 2003;
192 [object release]; 216 [object release];
193 } delay:2.0f]; 217 } delay:2.0f];
218 } else if ([currentTutorial.name isEqual:@"gameover-rock"])
219 {
220 [self scheduleDelayedAction:^{
221 FallingObject* object = [self dropRandomItem];
222 object.sprite.tag = 2010;
223 [object release];
224 } delay:1.0f];
194 } else if ([currentTutorial.name isEqual:@"intense"]) 225 } else if ([currentTutorial.name isEqual:@"intense"])
195 { 226 {
196 [self schedule:@selector(randomlyAddObject:) interval:1.0f]; 227 [self schedule:@selector(randomlyAddObject:) interval:1.0f];
@@ -252,20 +283,6 @@
252 return [self dropSpecificItem:object]; 283 return [self dropSpecificItem:object];
253} 284}
254 285
255- (void)setLives:(int)m_lives
256{
257 [super setLives:m_lives];
258
259 if ((lives < 1) && (!showedDeathBubble))
260 {
261 showedDeathBubble = YES;
262
263 TutorialBubble* bubble = [[TutorialBubble alloc] initWithText:@"You lost all your lives! Normally, you'd be taken to a game over screen where you could submit your score to the highscore list, but we're a bit more forgiving in tutorial mode." name:@"gameover"];
264 self.currentTutorial = bubble;
265 [bubble release];
266 }
267}
268
269- (void)randomlyAddObject:(ccTime)dt 286- (void)randomlyAddObject:(ccTime)dt
270{ 287{
271 FallingObject* object; 288 FallingObject* object;