-
Notifications
You must be signed in to change notification settings - Fork 0
/
AbstractRuneDrawingAnimation.m
65 lines (49 loc) · 1.43 KB
/
AbstractRuneDrawingAnimation.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//
// AbstractRuneDrawingAnimation.m
// TEORWorldMapTest
//
// Created by Zach Babb on 6/4/11.
// Copyright 2011 InstantLazer. All rights reserved.
//
#import "AbstractRuneDrawingAnimation.h"
#import "PackedSpriteSheet.h"
#import "GameController.h"
#import "AbstractScene.h"
#import "Image.h"
@implementation AbstractRuneDrawingAnimation
@synthesize essenceColor;
@synthesize runeText;
@synthesize rune;
- (void)dealloc {
[super dealloc];
}
- (id)init {
if (self = [super init]) {
runeDrawingImage = [[GameController sharedGameController].teorPSS imageForKey:@"defaultTexture.png"];
active = YES;
stage = 0;
duration = 0;
}
return self;
}
- (void)updateWithDelta:(float)aDelta {
if (active) {
duration -= aDelta;
currentPosition = CGPointMake(currentPosition.x + (velocity.x * aDelta), currentPosition.y + (velocity.y * aDelta));
if (velocity.x != 0 || velocity.y != 0) {
Image *drawingImage = [[runeDrawingImage imageDuplicate] retain];
drawingImage.color = essenceColor;
drawingImage.renderPoint = currentPosition;
[[GameController sharedGameController].currentScene addImageToDrawingImages:drawingImage];
[drawingImage release];
}
}
}
- (void)render {}
- (void)moveFromPoint:(CGPoint)aFromPoint toPoint:(CGPoint)aToPoint {
currentPosition = aFromPoint;
velocity = Vector2fMake((aToPoint.x - aFromPoint.x) / 0.5, (aToPoint.y - aFromPoint.y) / 0.5);
duration = 0.5;
}
- (void)resetAnimation {}
@end