diff options
Diffstat (limited to 'Classes')
| -rwxr-xr-x | Classes/CocosOverlayScrollView.m | 6 | ||||
| -rw-r--r-- | Classes/GameMode.h | 2 | ||||
| -rw-r--r-- | Classes/GameMode.m | 12 | ||||
| -rw-r--r-- | Classes/GameModeSelectionLayer.m | 3 | ||||
| -rw-r--r-- | Classes/TutorialMode.m | 8 |
5 files changed, 21 insertions, 10 deletions
| diff --git a/Classes/CocosOverlayScrollView.m b/Classes/CocosOverlayScrollView.m index dee9dfe..9db0575 100755 --- a/Classes/CocosOverlayScrollView.m +++ b/Classes/CocosOverlayScrollView.m | |||
| @@ -100,7 +100,11 @@ | |||
| 100 | 100 | ||
| 101 | - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView | 101 | - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView |
| 102 | { | 102 | { |
| 103 | [pageControl setCurrentPage:(NSUInteger)([scrollView contentOffset].x / [scrollView frame].size.width)]; | 103 | int currentPage = (NSUInteger)(scrollView.contentOffset.x / scrollView.frame.size.width); |
| 104 | NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; | ||
| 105 | [defaults setInteger:currentPage forKey:@"lastSelectedMode"]; | ||
| 106 | |||
| 107 | [pageControl setCurrentPage:currentPage]; | ||
| 104 | } | 108 | } |
| 105 | 109 | ||
| 106 | @end \ No newline at end of file | 110 | @end \ No newline at end of file |
| diff --git a/Classes/GameMode.h b/Classes/GameMode.h index 890106e..53ed9fc 100644 --- a/Classes/GameMode.h +++ b/Classes/GameMode.h | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | #define GAME_SCENE 436 | 12 | #define GAME_SCENE 436 |
| 13 | #define GAME_LAYER 437 | 13 | #define GAME_LAYER 437 |
| 14 | 14 | ||
| 15 | @interface GameMode : CCLayer { | 15 | @interface GameMode : CCLayer <UIAlertViewDelegate> { |
| 16 | NSMutableSet* objects; | 16 | NSMutableSet* objects; |
| 17 | int score; | 17 | int score; |
| 18 | int lives; | 18 | int lives; |
| diff --git a/Classes/GameMode.m b/Classes/GameMode.m index 7b07f15..8f695d1 100644 --- a/Classes/GameMode.m +++ b/Classes/GameMode.m | |||
| @@ -146,7 +146,9 @@ | |||
| 146 | 146 | ||
| 147 | - (void)mainmenu | 147 | - (void)mainmenu |
| 148 | { | 148 | { |
| 149 | [[CCDirector sharedDirector] replaceScene:[MainMenuLayer scene]]; | 149 | UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Cartographic" message:@"Are you sure you want to quit the currently playing game?" delegate:self cancelButtonTitle:@"Yes" otherButtonTitles:@"No", nil]; |
| 150 | [alert show]; | ||
| 151 | [alert release]; | ||
| 150 | } | 152 | } |
| 151 | 153 | ||
| 152 | - (void)setScore:(int)m_score | 154 | - (void)setScore:(int)m_score |
| @@ -179,6 +181,14 @@ | |||
| 179 | delayedAction = nil; | 181 | delayedAction = nil; |
| 180 | } | 182 | } |
| 181 | 183 | ||
| 184 | - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex | ||
| 185 | { | ||
| 186 | if (buttonIndex == 0) | ||
| 187 | { | ||
| 188 | [[CCDirector sharedDirector] replaceScene:[MainMenuLayer scene]]; | ||
| 189 | } | ||
| 190 | } | ||
| 191 | |||
| 182 | - (void)dealloc | 192 | - (void)dealloc |
| 183 | { | 193 | { |
| 184 | [objects release]; | 194 | [objects release]; |
| diff --git a/Classes/GameModeSelectionLayer.m b/Classes/GameModeSelectionLayer.m index a12d435..4c4845d 100644 --- a/Classes/GameModeSelectionLayer.m +++ b/Classes/GameModeSelectionLayer.m | |||
| @@ -132,9 +132,6 @@ | |||
| 132 | 132 | ||
| 133 | - (void)didSelectGameMode:(GameModeSelection *)gameMode | 133 | - (void)didSelectGameMode:(GameModeSelection *)gameMode |
| 134 | { | 134 | { |
| 135 | NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; | ||
| 136 | [defaults setInteger:[gameModes indexOfObject:gameMode] forKey:@"lastSelectedMode"]; | ||
| 137 | |||
| 138 | if ([gameMode.name isEqual:@"Tutorial"]) | 135 | if ([gameMode.name isEqual:@"Tutorial"]) |
| 139 | { | 136 | { |
| 140 | [[CCDirector sharedDirector] replaceScene:[TutorialMode scene]]; | 137 | [[CCDirector sharedDirector] replaceScene:[TutorialMode scene]]; |
| diff --git a/Classes/TutorialMode.m b/Classes/TutorialMode.m index 1285597..3c70a46 100644 --- a/Classes/TutorialMode.m +++ b/Classes/TutorialMode.m | |||
| @@ -48,7 +48,7 @@ | |||
| 48 | [super onEnterTransitionDidFinish]; | 48 | [super onEnterTransitionDidFinish]; |
| 49 | 49 | ||
| 50 | [self scheduleDelayedAction:^{ | 50 | [self scheduleDelayedAction:^{ |
| 51 | TutorialBubble* bubble = [[TutorialBubble alloc] initWithText:@"Welcome to Cart Collect. This is a tutorial designed to help you get started playing the game. Below this bubble is a cart. Tilt your device to move it." name:@"cart" spriteReference:cart.sprite]; | 51 | TutorialBubble* bubble = [[TutorialBubble alloc] initWithText:@"Welcome to Cartographic. This is a tutorial designed to help you get started playing the game. Below this bubble is a cart. Tilt your device to move it." name:@"cart" spriteReference:cart.sprite]; |
| 52 | self.currentTutorial = bubble; | 52 | self.currentTutorial = bubble; |
| 53 | [bubble release]; | 53 | [bubble release]; |
| 54 | } delay:2.0f]; | 54 | } delay:2.0f]; |
| @@ -131,13 +131,13 @@ | |||
| 131 | self.currentTutorial = bubble; | 131 | self.currentTutorial = bubble; |
| 132 | [bubble release]; | 132 | [bubble release]; |
| 133 | } else { | 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"]; | 134 | TutorialBubble* bubble = [[TutorialBubble alloc] initWithText:@"As you play, Cartographic 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; | 135 | self.currentTutorial = bubble; |
| 136 | [bubble release]; | 136 | [bubble release]; |
| 137 | } | 137 | } |
| 138 | } else if (item.sprite.tag == 2010) | 138 | } else if (item.sprite.tag == 2010) |
| 139 | { | 139 | { |
| 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"]; | 140 | TutorialBubble* bubble = [[TutorialBubble alloc] initWithText:@"As you play, Cartographic gets progressively more intense. Watch what happens when rocks are added to the mix and the speed is turned up." name:@"intense"]; |
| 141 | self.currentTutorial = bubble; | 141 | self.currentTutorial = bubble; |
| 142 | [bubble release]; | 142 | [bubble release]; |
| 143 | } | 143 | } |
| @@ -324,7 +324,7 @@ | |||
| 324 | } else if (randomItemsDropped == 15) | 324 | } else if (randomItemsDropped == 15) |
| 325 | { | 325 | { |
| 326 | [self scheduleDelayedAction:^{ | 326 | [self scheduleDelayedAction:^{ |
| 327 | TutorialBubble* bubble = [[TutorialBubble alloc] initWithText:@"That's pretty much it! You've completed the tutorial, so now it's time to play an actual game of Cart Collect!" name:@"end"]; | 327 | TutorialBubble* bubble = [[TutorialBubble alloc] initWithText:@"That's pretty much it! You've completed the tutorial, so now it's time to play an actual game of Cartographic!" name:@"end"]; |
| 328 | self.currentTutorial = bubble; | 328 | self.currentTutorial = bubble; |
| 329 | [bubble release]; | 329 | [bubble release]; |
| 330 | } delay:2.0f]; | 330 | } delay:2.0f]; |
