diff options
author | Starla Insigna <starla4444@gmail.com> | 2011-08-07 10:04:54 -0400 |
---|---|---|
committer | Starla Insigna <starla4444@gmail.com> | 2011-08-07 10:04:54 -0400 |
commit | 1d9ed882de4e2e3a53cdd5e90edc25e8ae10af1b (patch) | |
tree | 4a8f7445cf57b4de4295f81ff0a70c6b5f49c978 /Classes/PauseLayer.m | |
parent | 0a8fed12704bf343ad9604f964b71b3f50495382 (diff) | |
download | cartcollect-1d9ed882de4e2e3a53cdd5e90edc25e8ae10af1b.tar.gz cartcollect-1d9ed882de4e2e3a53cdd5e90edc25e8ae10af1b.tar.bz2 cartcollect-1d9ed882de4e2e3a53cdd5e90edc25e8ae10af1b.zip |
Implemented tutorial bubbles
GameLayer now has support for pausing game flow and displaying a tutorial bubble that the user can tap to dismiss. No code has been written, however, to make use of this, because I think it may be simpler to abstract GameLayer out somewhat and create a separate game mode for the tutorial. Deliberation required. PauseLayer has also been removed and the behavior has been brought into GameLayer. Refs #193
Diffstat (limited to 'Classes/PauseLayer.m')
-rwxr-xr-x | Classes/PauseLayer.m | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/Classes/PauseLayer.m b/Classes/PauseLayer.m deleted file mode 100755 index 53574b2..0000000 --- a/Classes/PauseLayer.m +++ /dev/null | |||
@@ -1,68 +0,0 @@ | |||
1 | // | ||
2 | // PauseLayer.m | ||
3 | // Cart Collect | ||
4 | // | ||
5 | // Created by iD Student Account on 7/20/11. | ||
6 | // Copyright 2011 __MyCompanyName__. All rights reserved. | ||
7 | // | ||
8 | |||
9 | #import "PauseLayer.h" | ||
10 | |||
11 | @implementation PauseLayer | ||
12 | |||
13 | + (CCScene*)sceneWithScene:(CCScene*)scene2 | ||
14 | { | ||
15 | CCScene* scene = [CCScene node]; | ||
16 | |||
17 | CCLayerColor* backgroundLayer = [CCLayerColor layerWithColor:ccc4(255, 255, 255, 255)]; | ||
18 | CCSprite* backgroundImage = [CCSprite spriteWithFile:@"SeaBeach.png"]; | ||
19 | backgroundImage.position = ccp(240,160); | ||
20 | [backgroundLayer addChild:backgroundImage]; | ||
21 | [scene addChild:backgroundLayer]; | ||
22 | |||
23 | CCLayerColor* backgroundLayer2 = [CCLayerColor layerWithColor:ccc4(0, 0, 0, 127)]; | ||
24 | [scene addChild:backgroundLayer2]; | ||
25 | |||
26 | PauseLayer* layer = [[[PauseLayer alloc] initWithScene:scene2] autorelease]; | ||
27 | [scene addChild:layer]; | ||
28 | |||
29 | return scene; | ||
30 | } | ||
31 | |||
32 | - (id)initWithScene:(CCScene*)scene | ||
33 | { | ||
34 | self = [super init]; | ||
35 | |||
36 | if (nil != self) | ||
37 | { | ||
38 | game = [scene retain]; | ||
39 | |||
40 | CCLabelBMFont* scoreLabel = [CCLabelBMFont labelWithString:@"PAUSE" fntFile:@"helvetica.fnt"]; | ||
41 | scoreLabel.position = ccp(240,90); | ||
42 | [self addChild:scoreLabel]; | ||
43 | |||
44 | CCMenuItemImage* pauseButton = [CCMenuItemImage itemFromNormalImage:@"pause2.png" selectedImage:@"pause.png" target:self selector:@selector(unpause)]; | ||
45 | CCMenu* pauseMenu = [CCMenu menuWithItems:pauseButton, nil]; | ||
46 | [pauseMenu setPosition:ccp(480-8-16, 320-8-16)]; | ||
47 | [self addChild:pauseMenu]; | ||
48 | |||
49 | CCMenuItemImage* newgameMenuItem = [CCMenuItemImage itemFromNormalImage:@"back.png" selectedImage:@"back2.png" target:self selector:@selector(newgame)]; | ||
50 | CCMenu* myMenu = [CCMenu menuWithItems:newgameMenuItem, nil]; | ||
51 | myMenu.position = ccp(240, 60); | ||
52 | [self addChild:myMenu]; | ||
53 | } | ||
54 | |||
55 | return self; | ||
56 | } | ||
57 | |||
58 | - (void)unpause | ||
59 | { | ||
60 | [[CCDirector sharedDirector] replaceScene:game]; | ||
61 | } | ||
62 | |||
63 | - (void)newgame | ||
64 | { | ||
65 | [[CCDirector sharedDirector] replaceScene:[MainMenuLayer scene]]; | ||
66 | } | ||
67 | |||
68 | @end | ||