about summary refs log tree commit diff stats
path: root/data/maps/the_digital/rooms/Main Area.txtpb
blob: 99bcdccdd4ba191ecc6d689ddb48a4652a10bbca (plain
//
//  ValuableObject.m
//  Cart Collect
//
//  Created by Starla Insigna on 8/9/11.
//  Copyright 2011 Four Island. All rights reserved.
//

#import "ValuableObject.h"
#import "GameMode.h"
#import "SimpleAudioEngine.h"

@implementation ValuableObject

- (id)init
{
    self = [super init];
    if (self) {
        // Initialization code here.
    }
    
    return self;
}

- (void)collideWithCart
{
    GameMode* gameLayer = ((GameMode*) sprite.parent);
    [gameLayer setScore:gameLayer.score+self.pointValue];<
[[NSBundle mainBundle] pathForResource:@"Item1" ofType:@"wav"]]; } - (void)collideWithFloor { GameMode* gameLayer = ((GameMode*) sprite.parent); [gameLayer setLives:gameLayer.lives-1]; [[SimpleAudioEngine sharedEngine] playEffect:[[NSBundle mainBundle] pathForResource:@"Damage1" ofType:@"wav"]]; } - (int)pointValue { @throw [NSException exceptionWithName:NSInternalInconsistencyException reason:[NSString stringWithFormat:@"You must override %@ in a subclass", NSStringFromSelector(_cmd)] userInfo:nil]; } @end