From ab9f7381455b334fa0df563e21775410be74ea45 Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Sat, 10 Sep 2011 10:04:18 -0400 Subject: Added point multipliers There is support for point multipliers for any game mode, but only Jump currently utilizes it. Closes #222 --- Classes/PointMultiplier.m | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Classes/PointMultiplier.m (limited to 'Classes/PointMultiplier.m') 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 @@ +// +// PointMultiplier.m +// Cartographic +// +// Created by Starla Insigna on 9/10/11. +// Copyright (c) 2011 Four Island. All rights reserved. +// + +#import "PointMultiplier.h" +#import "GameMode.h" +#import "SimpleAudioEngine.h" + +@implementation PointMultiplier + +- (id)init +{ + self = [super init]; + + if (nil != self) + { + sprite = [CCSprite spriteWithFile:@"multiplier.png"]; + weight = 8; + } + + return self; +} + +- (void)collideWithCart +{ + GameMode* gameLayer = ((GameMode*) sprite.parent); + [gameLayer setPointMultiplier:gameLayer.pointMultiplier+1]; + + [[SimpleAudioEngine sharedEngine] playEffect:[[NSBundle mainBundle] pathForResource:@"Item1" ofType:@"wav"]]; +} + +@end -- cgit 1.4.1