-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLibrary.h
More file actions
155 lines (149 loc) · 2.76 KB
/
Copy pathLibrary.h
File metadata and controls
155 lines (149 loc) · 2.76 KB
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#ifndef ArboLib
#define ArboLib
#include <GL/freeglut.h>
unsigned char pixel[3] = { 0, 255, 0 };
unsigned char red[3] = { 255, 0, 0 };
typedef struct _GameObject
{
unsigned char busy;
unsigned char current_animation;
unsigned char animations;
struct model* animation;
int x;
int y;
int lx, ty, rx; //Object Edge
signed char vector; //Eyesight vector
unsigned char air_state; //0 - ground, 1 - flies up, 2 - falls
unsigned char weight; //Falling offset
} GameObject;
//Animation's frame structure
struct model
{
unsigned char* frame;
int id;
int msecs;
int frames;
int name;
unsigned char loop;
unsigned char interruptable;
int height;
int width;
};
struct _GameObject** GameObjects;
int gmlen;
typedef struct _GameActor
{
GameObject itself;
int hp;
int speed;
int jump;
int dexterity;
int strength;
int accuracy;
int adequacy;
int vitality;
int mysticism;
int blood_rust;
//Actor controller status
char stunned;
}GameActor;
typedef struct _Enemy
{
GameActor inner;
int aggression;
}Enemy;
typedef struct _Entity
{
GameObject itself;
int hp;
short invulnerable;
short walkthrough;
}Entity;
//A union for universal work with the GameObjects
union _Convertor
{
struct _GameObject* toGameObject;
struct _GameActor* toGameActor;
}Convertor;
GameActor player;
//An image with width(sizeX) and height(sizeY)
//+Data
typedef struct _AUX_RGBImageRec
{
GLint sizeX, sizeY;
unsigned char *data;
} AUX_RGBImageRec;
//An array where all loaded images are located
struct _mainArray
{
AUX_RGBImageRec *main_arr;
int length;
} main_array;
#define mainArray main_array.main_arr
//The structure that describes a certain area/zone
struct response
{
int id;
int x;
int y;
int width;
int height;
};
struct _OrderToClear
{
struct response* area;
int last_id;
} OrderToClear;
//The structure of one frame for the FrameOrder
struct line
{
//The time when the frame was set
long sent_time;
//How much time should the frame be shown
int msecs;
GameObject* object;
//The frame number
int frame;
};
//The FrameOrder
struct line order[10];
//A structure of one action for the ActionQueue
struct row
{
//The time when the action was set
long sent_time;
//Action func
void (*todo) (struct row*);
//Subject
GameObject* object;
//Milliseconds
int msecs;
//Additional variable 1
int help1;
//Additional variable 2
int help2;
//Action's stage
int step;
};
//The ActionQueue
struct row* queue;
enum Animations
{
idle = 0,
run0 = 1,
run1 = 2,
jump0 = 3,
jump1 = 4,
attack01 = 5
};
//Magic 2D path eye
unsigned char** TechMap;
//Image names
char** StringPool;
void moveObject(GameObject *object, int key);
void playerController(int id);
void playAnimation(GameObject* object, int animation);
int resetAnimation(GameObject* object);
int times;
Entity grass;
#endif // !ArboLib