summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asset_defs.h4
-rw-r--r--include/bullets.h1
-rw-r--r--include/guns.h7
-rw-r--r--include/map.h4
-rw-r--r--include/math_helper.h1
-rw-r--r--include/zombie_chunk.h30
6 files changed, 41 insertions, 6 deletions
diff --git a/include/asset_defs.h b/include/asset_defs.h
index 480f97f..aff621d 100644
--- a/include/asset_defs.h
+++ b/include/asset_defs.h
@@ -7,9 +7,11 @@ font* fnt_24;
font* fnt_20;
image* img_icon_bullets;
-
image* img_icon_nova;
+image* img_zombie_chunk_hand;
+image* img_zombie_chunk_foot;
+
void load_assets();
#endif \ No newline at end of file
diff --git a/include/bullets.h b/include/bullets.h
index 1828f38..76cd01c 100644
--- a/include/bullets.h
+++ b/include/bullets.h
@@ -15,6 +15,7 @@ typedef struct t_bullet {
float endx;
float endy;
float alive_time;
+ int damage;
} bullet;
bullet bullets[500] = {0};
diff --git a/include/guns.h b/include/guns.h
index 1b93781..2c22c00 100644
--- a/include/guns.h
+++ b/include/guns.h
@@ -17,12 +17,13 @@ typedef struct t_gun {
float bullet_spread;
int bullets_per_shot;
float shots_per_second;
+ int damage;
} gun;
gun guns[GUN_ALL] = {
- {GUN_DESERTEAGLE, "Desert Eagle", 8, 64, 0.0f, 1, 4.0f},
- {GUN_MP5, "MP5", 30, 120, 0.1f, 1, 10.0f},
- {GUN_NOVA, "Nova", 12, 80, 0.2f, 3, 1.2f},
+ {GUN_DESERTEAGLE, "Desert Eagle", 8, 64, 0.0f, 1, 4.0f, 350},
+ {GUN_MP5, "MP5", 30, 120, 0.1f, 1, 10.0f, 150},
+ {GUN_NOVA, "Nova", 12, 80, 0.2f, 3, 1.2f, 600},
};
image* get_image_of_gun(gun_type type);
diff --git a/include/map.h b/include/map.h
index 26bc749..8f153f8 100644
--- a/include/map.h
+++ b/include/map.h
@@ -58,8 +58,8 @@ int map[MAP_SIZE_Y][MAP_SIZE_X] = {
};
void load_map_from_data();
-tile get_tile_under_coords(platform_window* window, float x, float y);
-float get_height_of_tile_under_coords(platform_window* window, float tocheckx, float tochecky);
+tile get_tile_under_coords(float x, float y);
+float get_height_of_tile_under_coords(float tocheckx, float tochecky);
int get_tile_height(platform_window* window);
int get_tile_width(platform_window* window);
bool is_in_bounds(float x, float y);
diff --git a/include/math_helper.h b/include/math_helper.h
index ca27e14..be46bdc 100644
--- a/include/math_helper.h
+++ b/include/math_helper.h
@@ -20,5 +20,6 @@ bool lines_intersect(vec2f p1, vec2f q1, vec2f p2, vec2f q2);
vec2f get_intersection_point(vec2f A, vec2f B, vec2f C, vec2f D);
box get_render_box_of_square(platform_window* window, vec3f position, vec3f size);
box get_box_of_square(vec3f position, vec3f size);
+vec3f get_center_of_square(vec3f position, vec3f size);
#endif \ No newline at end of file
diff --git a/include/zombie_chunk.h b/include/zombie_chunk.h
new file mode 100644
index 0000000..bbf4c81
--- /dev/null
+++ b/include/zombie_chunk.h
@@ -0,0 +1,30 @@
+#ifndef ZOMBIE_CHUNK
+#define ZOMBIE_CHUNK
+
+#include <projectbase/project_base.h>
+
+#include "objects.h"
+
+typedef struct t_zombie_chunk {
+ bool active;
+ vec3f start_position;
+ vec3f position;
+ vec3f target_position;
+ float duration;
+ vec2f direction;
+ image* img;
+ float rotation;
+} zombie_chunk;
+
+#define MAX_ZOMBIE_CHUNKS (50)
+zombie_chunk zombie_chunks[MAX_ZOMBIE_CHUNKS] = {0};
+
+#define CHUNK_DURATION_OF_DROP (0.6f)
+#define CHUNK_MAX_DURATION (5.0f)
+#define CHUNK_FADE_TIME (2.0f)
+
+void draw_zombie_chunks(platform_window* window);
+void spawn_zombie_chunk(vec3f center);
+void update_zombie_chunks();
+
+#endif \ No newline at end of file