-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameObject.m
44 lines (32 loc) · 821 Bytes
/
GameObject.m
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
37
38
39
40
41
42
43
44
//
// GameObject.m
// RoboBird Space IOS 7
//
// Created by JOSH AND SARI on 7/25/14.
// Copyright (c) 2014 josue. All rights reserved.
//
#import "GameObject.h"
@implementation GameObject
- (instancetype)initWithImageNamed:(NSString *)name {
if ((self = [super initWithImageNamed:name])) {
}
return self;
}
-(void)update:(CFTimeInterval)dt {
}
-(void)cleanup {
[self removeFromParent];
[self removeAllActions];
}
-(void)destroy {
self.physicsBody = nil;
[self removeAllActions];
[self runAction:[SKAction sequence:@[[SKAction fadeAlphaTo:0 duration:0.2],[SKAction runBlock:^{
[self cleanup];
}]
]]
];
}
-(void)collidedWith:(SKPhysicsBody *)body contact:(SKPhysicsContact *)contact {
}
@end