aboutsummaryrefslogtreecommitdiff
path: root/src/object.h
blob: 8da299a3171050684070196435c0e9c17f8966d3 (plain)
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
#ifndef OBJECT_H
#define OBJECT_H

#include "collision.h"

typedef struct {
	void* data; //Specific object struct
	void (*objectStep)();
	void (*objectDraw)();
	int type;
} Object;

void objectDestroy(int id);

//Health/Ammo collectables
typedef struct {
	int id, type; //0 for ammo, 1 for heart
	double x, y,
		   vsp, grav;
		   
	int blink, canLand, bounce;
} Ammo;

void spawnCollectable(int x, int y);
void createAmmo(int x, int y, int type);

//Destroyable blocks
typedef struct {
	int id;
	int x, y;
	int hp/*, invulnerable*/;
	int secret;
	Mask mask;
} Destroyable;

void createDestroyable(int x, int y, int secret);

//Secret Trigger
typedef struct {
	int id, flag;
	int type, enemyType;
} SecretTrigger;

void createSecretTrigger(int type, int enemyType, int flag);

//Chest
typedef struct {
	int id;
	int x, y;
	int item, secret;
	int visible;
	int timer;
	
	Mask mask;
} Chest;

void createChest(int x, int y, int item, int secret);

//Save point
typedef struct {
	int id;
	int x, y;
	double imageIndex;
	
	Mask mask;
} SavePoint;

void createSavePoint(int x, int y, int hidden);

//Door
typedef struct {
	int id;
	int x, y;
	int open, secret, visible;
	
	int warplevel, warpcoords;
	int warpx, warpy;
	
	Mask mask;
} Door;

void createDoor(int x, int y, int level, int coords, int warpx, int warpy, int secret);

//Lock Block
typedef struct {
	int id, flag;
	int x, y;
	int tile;
	int invincible;
} LockBlock;

void createLockBlock(int x, int y, int flag);

//Light Switch
typedef struct {
	int id, flag;
	int x, y;
	int activated;
	double imageIndex;
} Switch;

void createSwitch(int x, int y, int flag);

//Blue/Red Gates
typedef struct {
	int id;
	int x, y;
	int col;
	int timer, open;
	//int invincible;
	double imageIndex;	
} Gate;

void createGate(int x, int y, int col);

//Statue
typedef struct {
	int id;
	int x, y;
	int type;
	int invincible;
	int hp;
} Statue;

void createStatue(int x, int y, int type);

//Button
typedef struct {
	int id;
	int x, y;
	int flag;
	int pressed;
} FloorPad;

void createFloorPad(int x, int y, int flag);

//Ladder
typedef struct {
	int id;
	int x, y;
	int flag;
} Ladder;

void createLadder(int x, int y, int flag);

//Generator
typedef struct {
	int id;
	int hp;
	int blink;
	int x, y;
	double imageIndex;
	int flag;
} Generator;

void createGenerator(int x, int y, int flag);

//Electric gate
typedef struct {
	int id;
	int x, y;
	double imageIndex;
	int flag;
} Shockgate;

void createShockgate(int x, int y, int flag);

//Ending crown
typedef struct {
	int id;
	int x, ystart;
	double y;
	double bobRot;
	double imageIndex;
	int timer;
	char visible;
} Crown;

void createCrown(int x, int y);

#endif