summary refs log tree commit diff stats
path: root/Classes/PointMultiplier.m
blob: 0a9649d71842f914b51cb6f9d8c7288a88d8edd5 (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:@"Absorption2" ofType:@"wav"]];
}

@end