aboutsummaryrefslogtreecommitdiff
path: root/world.h
blob: 14e2447bdc8689c78dd926fe744f29b854b7d899 (plain) (blame)
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
#ifndef world_h
#define world_h

#include "map.h"
#include "obj.h"

#define max_particles 32
#define max_enemies 16
#define max_deathzones 16

struct Renderer;

typedef struct World {
	Particle particles[max_particles];
	Enemy enemies[max_enemies];
	Deathzone deathzones[max_deathzones];
	int particle_count, enemy_count;
	int deathzone_count;
	Player player;
	Map map;
} World;

void init_world(World* w);
Particle* inst_particle(
	World* w,
	int x,
	int y,
	int anim,
	int bmp
);
Enemy* inst_enemy(
	World* w,
	Enemy_Type t,
	int x,
	int y
);
Deathzone* inst_deathzone(
	World* w,
	const Rect* r,
	int vx,
	int vy,
	int hp,
	int life,
	int friendly
);
void update_world(World* w, const struct App* a);
void ren_world(const World* w, struct Renderer* r);

#endif