-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanimation.c
50 lines (40 loc) · 1.03 KB
/
animation.c
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
// pad stuff
typedef struct {
u_short u0, v0; // coordinates of top-left corner of uv
//~ short pause;
short Xoffset;
short Yoffset;
short index;
} frame;
typedef struct {
char timer;
char animCursor;
char hit;
frame *anim;
} charSprite;
frame iddle[1];
frame aim[6];
frame jump[6];
frame reload[6];
frame reload_arrow[3];
frame arrow[1];
frame balloon[8];
frame ammunitions[1];
frame parchment[1];
frame messages[2];
frame bubble[1];
frame bee[3];
frame target[1];
frame menu[1];
frame inst[1];
frame *currentFrame;
void setAnimSheet(char line, frame array[], short arraySize, char gridWidth, char gridHeight, short Xoffset, short Yoffset){
for (int i = 0; i < arraySize ;i++){
array[i].u0 = (i * gridWidth ) + Xoffset;
array[i].v0 = (line * gridHeight) + Yoffset;
//array[i].pause = 40;
array[i].Xoffset = 0;
array[i].Yoffset = 0;
array[i].index = i;
}
}