summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrik@amftech.nl>2022-12-27 09:05:33 +0100
committerAldrik Ramaekers <aldrik@amftech.nl>2022-12-27 09:05:33 +0100
commitd055cf69c8925e895cfcb726a4339f843f3ccfc1 (patch)
tree895f6f7d22272810f7d350f1b5f9b5b2c7dddd30 /include
parent88fb94168c87dd8cc07e16cb988e0ea5c25bc202 (diff)
work
Diffstat (limited to 'include')
-rw-r--r--include/asset_defs.h4
-rw-r--r--include/map.h37
-rw-r--r--include/objects.h1
-rw-r--r--include/players.h2
4 files changed, 43 insertions, 1 deletions
diff --git a/include/asset_defs.h b/include/asset_defs.h
index d6af444..10919b4 100644
--- a/include/asset_defs.h
+++ b/include/asset_defs.h
@@ -12,6 +12,10 @@ image* img_icon_nova;
image* img_drop;
image* img_spawner;
+image* img_obj_plants;
+image* img_obj_wall1;
+image* img_player;
+
image* img_zombie_chunk_hand;
image* img_zombie_chunk_foot;
image* img_zombie_chunk_blood;
diff --git a/include/map.h b/include/map.h
index 8f153f8..6109c5a 100644
--- a/include/map.h
+++ b/include/map.h
@@ -23,7 +23,7 @@ typedef struct t_tile {
} tile;
#define MAP_SIZE_X 40
-#define MAP_SIZE_Y 20
+#define MAP_SIZE_Y 40
tile map_loaded[MAP_SIZE_Y][MAP_SIZE_X];
@@ -34,6 +34,21 @@ typedef struct t_map_info {
float px_incline;
} map_info;
+typedef struct t_map_data {
+ int width;
+ int height;
+ int heightmap[MAP_SIZE_Y][MAP_SIZE_X];
+} map_data;
+
+typedef struct t_extracted_map_data {
+ int width;
+ int height;
+ tile heightmap[MAP_SIZE_Y][MAP_SIZE_X];
+} extracted_map_data;
+
+map_data map_to_load = {0};
+extracted_map_data loaded_map = {0};
+
// data data that is stored on disk
int map[MAP_SIZE_Y][MAP_SIZE_X] = {
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
@@ -55,6 +70,26 @@ int map[MAP_SIZE_Y][M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map_from_data();
diff --git a/include/objects.h b/include/objects.h
index 95e3739..50cd6f9 100644
--- a/include/objects.h
+++ b/include/objects.h
@@ -14,6 +14,7 @@ typedef struct t_object {
vec2f position;
vec3f size;
float h;
+ image* image;
} object;
typedef struct t_box {
diff --git a/include/players.h b/include/players.h
index 027fb31..c4652f2 100644
--- a/include/players.h
+++ b/include/players.h
@@ -8,6 +8,7 @@
#include "zombies.h"
#include "math_helper.h"
#include "guns.h"
+#include "sprite.h"
#define MAX_PLAYERS 10
@@ -27,6 +28,7 @@ typedef struct t_player {
network_client client; // For the host: is_connected = false and socket = 0
int kills;
u64 ping;
+ sprite sprite;
} player;
#include "protocol.h"