-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c~
86 lines (60 loc) · 1.31 KB
/
main.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
#include <stdlib.h>
#include "screen.c"
#include "audio_manager.c"
typedef struct Object
{
int x,y,character,color;
}Object;
Object *ObjectsHeap[901];
Object* CreateObject(int x,int y,int character,int color)
{
int ID = -1;
while(ObjectsHeap[ID] != NULL)
ID++;
ObjectsHeap[ID] = malloc(sizeof(Object));
ObjectsHeap[ID]->x = x;
ObjectsHeap[ID]->y = y;
ObjectsHeap[ID]->character = character;
ObjectsHeap[ID]->color = color;
return ObjectsHeap[ID];
}
void DrawChar(int x,int y,int character,int color)
{
Screen_drawParams sdp;
sdp.x = x;
sdp.y = y;
sdp.Character = character;
sdp.color_flags = color;
Screen_PlotChar(&sdp);
}
void DrawAllObjects()
{
int ID = -1;
Screen_drawParams sdp;
while(ObjectsHeap[ID] != NULL)
{
DrawChar(ObjectsHeap[ID]->x, ObjectsHeap[ID]->y ,ObjectsHeap[ID]->character ,ObjectsHeap[ID]->color);
ID++;
}
Screen_DrawBuffer();
}
int main()
{
Screen_Setup();
AudioLibrary_init();
char [30][30]=
{
{"......."}
};
for(int i = 0; i < 901; i++)
{
ObjectsHeap[i] = NULL;
}
//payloads stuff
for(int i = 0; i<900; i++)
{
CreateObject(rand()%900,rand()%900,15,15);
}
DrawAllObjects();
AudioLibrary_deinit();
}