summaryrefslogtreecommitdiffhomepage
path: root/src/bullet.h
blob: e335d7d412477b845b2aec25f139a410a8abfe01 (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
#pragma once

#include "rodeo.h"
#include "rodeo/collision.h"

typedef
struct
{
	world_id id;
	rodeo_color_RGBAFloat_t color;
}
bullet_t;

#define i_val bullet_t
#define i_opt c_no_cmp
#include "stc/cvec.h"

void
init_bullets(void);

void
deinit_bullets(void);

bullet_t *
spawn_bullet(
	float x,
	float y,
	float dx,
	float dy,
	rodeo_collision_2d_world_t *bullet_world,
	rodeo_color_RGBAFloat_t color
);

void
move_bullets(void);

bullet_t*
get_bullet_by_id(
	world_id id
);

void
draw_bullets(void);

rodeo_collision_2d_world_t *
get_enemy_bullet_world(void);

rodeo_collision_2d_world_t *
get_player_bullet_world(void);

void
bullet_destroy(
	cvec_bullet_t_value* bullet
);

void
detect_bullet_wall_collisions(void);