summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrik@amftech.nl>2022-12-08 13:05:51 +0100
committerAldrik Ramaekers <aldrik@amftech.nl>2022-12-08 13:05:51 +0100
commitf8b97f2450bb789ae54a1d8d3845110342ff6134 (patch)
tree92d25a57f60ead33c7209879e181bc01206fed69 /include
parent0c44af8f6c45e5bb957f38cc3e9784ca69524261 (diff)
work
Diffstat (limited to 'include')
-rw-r--r--include/map.h40
-rw-r--r--include/players.h10
-rw-r--r--include/zombies.h14
3 files changed, 41 insertions, 23 deletions
diff --git a/include/map.h b/include/map.h
index 0bf1028..735c106 100644
--- a/include/map.h
+++ b/include/map.h
@@ -22,13 +22,10 @@ typedef struct t_tile {
vec2f br;
} tile;
-tile map_loaded[10][10];
+#define MAP_SIZE_X 20
+#define MAP_SIZE_Y 20
-// data data that is stored on disk
-vec2 spawner_tiles[2] = {
- {9, 0},
- {1, 8},
-};
+tile map_loaded[MAP_SIZE_Y][MAP_SIZE_X];
typedef struct t_map_info {
int tile_width;
@@ -38,17 +35,26 @@ typedef struct t_map_info {
} map_info;
// data data that is stored on disk
-int map[10][10] = {
- {0,0,0,0,0,0,0,0,0,1},
- {0,0,0,0,0,0,0,0,0,0},
- {0,0,0,1,1,0,0,0,0,0},
- {0,0,0,0,0,0,0,0,0,0},
- {0,0,0,0,0,0,0,0,0,0},
- {0,0,0,0,0,0,0,0,0,0},
- {0,0,0,0,0,0,0,0,0,0},
- {0,0,0,1,1,2,1,0,0,0},
- {0,0,0,0,0,0,1,0,0,0},
- {0,0,0,0,0,0,0,0,0,0},
+int map[MAP_SIZE_Y][MAP_SIZE_X] = {
+ {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0},
+ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
+ {0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
+ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
+ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
+ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
+ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
+ {0,0,0,1,1,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0},
+ {0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0},
+ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
+ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
+ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
+ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
+ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
+ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
+ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
+ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
+ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
+ {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
};
void load_map_from_data();
diff --git a/include/players.h b/include/players.h
index b74ce7e..844cb17 100644
--- a/include/players.h
+++ b/include/players.h
@@ -8,16 +8,16 @@
typedef struct t_bullet {
bool active;
- float x;
- float y;
- float h;
- float xacceleration;
- float yacceleration;
+ vec3f position;
+ float endx;
+ float endy;
+ float alive_time;
} bullet;
bullet bullets[500] = {0};
int max_bullets = 500;
+float sec_since_last_shot = 10.0f;
float playerx = 3;
float playery = 3;
diff --git a/include/zombies.h b/include/zombies.h
index c9e22f1..44b2956 100644
--- a/include/zombies.h
+++ b/include/zombies.h
@@ -9,9 +9,21 @@
typedef struct t_zombie {
bool alive;
float health;
- vec2f position;
+ vec3f position;
+ vec3f size;
} zombie;
+typedef struct t_spawner {
+ vec2 position;
+ float sec_since_last_spawn;
+} spawner;
+
+// data data that is stored on disk
+spawner spawner_tiles[2] = {
+ {9, 0, 0},
+ {1, 8, 0},
+};
+
zombie zombies[50] = {0};
int max_zombies = 50;