-
Notifications
You must be signed in to change notification settings - Fork 0
/
animate.c
55 lines (45 loc) · 1.12 KB
/
animate.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
51
52
53
54
55
#include <allegro.h>
#include <jgmod.h>
#include "blocks3.h"
void Animate(void)
{
int i;
for (i = 0; i < ani_count; i++)
{
if (ani[i].type == SPLASH) Ani_Splash(i);
}
}
void Ani_Splash(int a)
{
ani[a].frame++;
if (ani[a].frame/10 == 0) DirtyList(ani[a].x, ani[a].y, ani[a].z, 32, 32, splash_pic[0]);
if (ani[a].frame/10 == 1) DirtyList(ani[a].x, ani[a].y, ani[a].z, 32, 32, splash_pic[1]);
if (ani[a].frame/10 == 2) DirtyList(ani[a].x, ani[a].y, ani[a].z, 32, 32, splash_pic[2]);
if (ani[a].frame/10 == 3) DirtyList(ani[a].x, ani[a].y, ani[a].z, 32, 32, splash_pic[3]);
if (ani[a].frame/10 == 4)
{
DirtyList(ani[a].x, ani[a].y, ani[a].z, 32, 32, blank);
Del_Ani(a);
}
}
void Del_Ani(int a)
{
int i;
for (i = a; i < ani_count; i++)
{
ani[i].x = ani[i + 1].x;
ani[i].y = ani[i + 1].y;
ani[i].z = ani[i + 1].z;
ani[i].type = ani[i + 1].type;
ani[i].frame = ani[i + 1].frame;
}
ani_count--;
}
void Add_Ani(int x, int y, int z, int type)
{
ani[ani_count].x = x;
ani[ani_count].y = y;
ani[ani_count].z = z;
ani[ani_count].type = type;
ani_count++;
}