diff options
Diffstat (limited to 'Classes/PointMultiplier.m')
-rw-r--r-- | Classes/PointMultiplier.m | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Classes/PointMultiplier.m b/Classes/PointMultiplier.m new file mode 100644 index 0000000..a14bf68 --- /dev/null +++ b/Classes/PointMultiplier.m | |||
@@ -0,0 +1,36 @@ | |||
1 | // | ||
2 | // PointMultiplier.m | ||
3 | // Cartographic | ||
4 | // | ||
5 | // Created by Starla Insigna on 9/10/11. | ||
6 | // Copyright (c) 2011 Four Island. All rights reserved. | ||
7 | // | ||
8 | |||
9 | #import "PointMultiplier.h" | ||
10 | #import "GameMode.h" | ||
11 | #import "SimpleAudioEngine.h" | ||
12 | |||
13 | @implementation PointMultiplier | ||
14 | |||
15 | - (id)init | ||
16 | { | ||
17 | self = [super init]; | ||
18 | |||
19 | if (nil != self) | ||
20 | { | ||
21 | sprite = [CCSprite spriteWithFile:@"multiplier.png"]; | ||
22 | weight = 8; | ||
23 | } | ||
24 | |||
25 | return self; | ||
26 | } | ||
27 | |||
28 | - (void)collideWithCart | ||
29 | { | ||
30 | GameMode* gameLayer = ((GameMode*) sprite.parent); | ||
31 | [gameLayer setPointMultiplier:gameLayer.pointMultiplier+1]; | ||
32 | |||
33 | [[SimpleAudioEngine sharedEngine] playEffect:[[NSBundle mainBundle] pathForResource:@"Item1" ofType:@"wav"]]; | ||
34 | } | ||
35 | |||
36 | @end | ||