diff options
| author | Aldrik Ramaekers <aldrik@amftech.nl> | 2022-12-15 17:16:06 +0100 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrik@amftech.nl> | 2022-12-15 17:16:06 +0100 |
| commit | f646069ca3baab4021e85de2ba19ce5f57e204fd (patch) | |
| tree | 69fc58df107d5c6d5af276a511db05104193bf01 /src/bullets.c | |
| parent | 66b82a20506b53ce8dc5dde8e6ea0979a22610f0 (diff) | |
bullet sync fix
Diffstat (limited to 'src/bullets.c')
| -rw-r--r-- | src/bullets.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/bullets.c b/src/bullets.c index 4431eff..7397e9f 100644 --- a/src/bullets.c +++ b/src/bullets.c @@ -180,6 +180,12 @@ static bool check_if_bullet_collided_with_ground(bullet *b, platform_window* win return false; } +void clear_bullets() { + for (int i = 0; i < max_bullets; i++) { + bullets[i].active = false; + } +} + void update_bullets(platform_window* window) { for (int i = 0; i < max_bullets; i++) { bullet b = bullets[i]; @@ -229,7 +235,5 @@ void draw_bullets(platform_window* window) { float bullet_render_y_end = b.endy*info.tile_height - (b.position.z*info.px_raised_per_h); renderer->render_line(bullet_render_x, bullet_render_y, bullet_render_x_end, bullet_render_y_end, 5, rgb(255, 51, 51)); - - bullets[i].active = false; } }
\ No newline at end of file |
