-
Notifications
You must be signed in to change notification settings - Fork 0
/
bonus monster.c
105 lines (88 loc) · 1.69 KB
/
bonus monster.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/***
*void bonus_monster
*
*Purpose:
* move the bonus monster on screen.
*
*Entry:
*
*Exit:
*
************************************************/
#include "atari.h"
void bonus_monster (
MONSTER *bonus,
short BackGround[][ROW + 1],
short screen[][ROW],
short Tools_Color[]
)
{
static bool flag = true;
char bonus_horizontal_shape[3] = {16, 4, 17};
char bonus_vertical_shape[3] = {31, 4, 30};
if (flag)
{
//clear vertical shape.
Clear_Object (
screen,
BackGround,
bonus -> x,
bonus -> y - 1,
0, 3
);
bonus -> x -- ;
//print horizontal shape.
screen[bonus -> x][bonus -> y] = BONUS_ON;
Move_Object (
BackGround,
bonus_horizontal_shape,
Tools_Color[BON],
bonus -> x - 1,
bonus -> y,
3, 0
);
flag = false;
}
else if (!flag)//horizontal
{
//clear horizontal shape.
Clear_Object (screen,
BackGround,
bonus -> x - 1,
bonus -> y,
3, 0);
bonus -> x --;
//print vertical shape.
screen[bonus -> x][bonus -> y] = BONUS_ON;
Move_Object (
BackGround,
bonus_vertical_shape,
Tools_Color[BON],
bonus -> x,
bonus -> y - 1,
0, 3
);
flag = true;
}
// clear & turn off in end of screen.
if (bonus -> x < 2)
{
Clear_Object (
screen,
BackGround,
bonus -> x - 1,
bonus -> y,
3, 0
);
Clear_Object (
screen,
BackGround,
bonus -> x ,
bonus -> y- 1,
0, 3
);
bonus -> on = false;
flag = true;
bonus -> x = COL - 10;//STARTING POINT.
}
}