-
Notifications
You must be signed in to change notification settings - Fork 0
/
move object.c
61 lines (53 loc) · 1.25 KB
/
move object.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
/***
*void Move_Object
*
*Purpose:
* print a string on the back ground,
* taking the back griund color from the back ground arrey.
*
*Entry:
* short BackGround[][ROW + 1] = hold the back ground colors numbers.
* char *Shape = get string with the shpe to print.
* int Color = get int for color of the shape.
* int X = the X of the starting point.
* int Y = the Y of the starting point.
* int Wide = number of char horizontal.
* int High = number of char vertical.
*
*Exit:
*
*
*******************************************************************************/
#include "atari.h"
void Move_Object (
short BackGround[][ROW + 1],
char *Shape,
int Color,
int X,
int Y,
int Wide,
int High
)
{
int j;
SetCursor (X, Y);
//move horizontal object.
for (j = 0; j < Wide; j++)
{
SetColor(
Color,
BackGround[X + j] [Y]
);
putch (Shape[j]);
}
//move vertical object.
for (j = 0; j < High; j++)
{
SetCursor (X, Y + j);
SetColor(
Color,
BackGround[X] [Y + j]
);
putch (Shape[j]);
}
}