summary refs log tree commit diff stats
path: root/Classes/PointMultiplier.m
blob: a14bf6839795cf80ab6c57d85f42272e3724c283 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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