-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.h
202 lines (187 loc) · 4.07 KB
/
main.h
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
#ifndef MAIN_H_INCLUDED
#define MAIN_H_INCLUDED
#define LEVELTYPES 2
#define ITEMS 5
#define BASICITEMS 3
#define PORTALPOSX 370
#define PORTALPOSY 150
typedef struct Shot
{
ALLEGRO_BITMAP *picture;
int wys;
int szer;
double posx;
double posy;
double posz;
double speedx;
double speedy;
double range;
int killsbunny; // 0 - rani wroga, 1 - rani krolisia
int type; //0 - shot, 1 - laser, 2 - lawa
double dmg;
double endtime; //laser, lawa
} Shot;
typedef struct Bunny
{
ALLEGRO_BITMAP *picture;
ALLEGRO_BITMAP *shotpic;
double posx;
double posy;
double posz;
int szer;
int wys;
int grub;
double kicspeed; // szybkosc kicania
int statex; // wysokosc kicniecia
int statey; // skierowanie buzki
int hp; // liczba polowek serduszek
int hearts; // max 6
double shotfreq; // 0.1 .. 0.6
int dmg; // 10 .. 60
double speed; //0.009 ..
int range; // 300 .. 700
double lastshot;
double shotspeed;
double step;
int shottype;
double immortal; // do kiedy nie moze byc raniony
int battery; //bonus do ladowania spacji
int boots; // bezbolesny bonus room
} Bunny;
typedef struct Enemy
{
ALLEGRO_BITMAP *picture;
ALLEGRO_BITMAP *shotpic;
int picposx;
int picposy;
double posx;
double posy;
double posz;
int wys;
int szer;
int grub;
double hp;
double lasthurt;
int number;
int statepos; //obrazek
int stateaction; // czynnosc
int statez;
int direct;
double nextdir;
double nextchange;
double step;
double lastshot;
double shotfreq;
int shottype;
int movetype;
double shotspeed;
int range;
int dmg;
double animetime;
double lastanime;
int deathtype; //0 - normal, 1 - fistula, 2 - shots, 3 - bomb,
} Enemy;
typedef struct Pickup
{
int posx;
int posy;
int posz;
int type; //0 - coin; 1-carrot; 2-bomb; 3- key;
int price;
struct Pickup *next;
struct Pickup *prev;
} Pickup;
typedef struct Item
{
ALLEGRO_BITMAP *picture;
int price;
int number;
int posx;
int posy;
int taken;
int frozen;
int spaceleft;
struct Item *prev;
struct Item *next;
} Item;
typedef struct Bomb
{
int posx;
int posy;
int killsenemy;
int state;
int color;
int exploded;
double time;
} Bomb;
typedef struct Room
{
int type; // typ pokoju - 0 normal, 1 item(klucz), 2 bonus(kolce), 3 boss, 4 sklep(klucz), 5 secret(bomba)
Pickup pickups[10];
int pickupcnt;
Item items[3];
int itemcnt;
Bomb bombs[8];
int bombcnt;
//Pickup *firstpickup;
struct Room *left;
struct Room *right;
struct Room *up;
struct Room *down;
int locked;
int doorsopen[4]; //0 - blocked(brama), 1 - open
Enemy enemies[16];
int enemycnt;
} Room;
typedef struct Level
{
ALLEGRO_BITMAP *picture;
ALLEGRO_BITMAP *logo;
char inffile[24];
int enemyfirst;
int enemylast;
int bossfirst;
int bosslast;
int itemfirst;
int itemlast;
} Level;
typedef struct Menu
{
ALLEGRO_BITMAP *picture;
int choice; //0 - newgame, 1 - options, 2-stats 3-about 4-quit
int screen; //0 menu glowne 1- options 2- stats 3- about
} Menu;
typedef struct Game
{
ALLEGRO_BITMAP *pickups, *hearts, *cyferki, *doors, *portal, *hellportal, *itempics, *background, *bombpic,
*keypic, *carrotpic, *coinpic, *tile, *dym, *enemies, *shotpics, *pause;
ALLEGRO_DISPLAY *display;
ALLEGRO_KEYBOARD_STATE keyboard;
int state; // 0 - menu, 1 - gra, 2- pauza
int portalstate;
int szer;
int wys;
Bunny bunny;
Level level;
int levelnum;
int roomcnt;
Room *firstroom;
Room *room;
Menu menu;
int sounds;
int music;
Shot shots[100];
int objects[6][2];
int objectcnt;
int shotcnt;
int coins;
int bombs;
int keys;
int maxlevelnum;
int spaceitem;
int spaceleft;
int usedlevels[LEVELTYPES];
int useditems[ITEMS];
double roomeffect[3]; // tears, dmg, shottype,
} Game;
#endif // MAIN_H_INCLUDED