From 2d2379251e71b5f315235db7980d0cfe03132561 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Thu, 29 Jun 2023 21:47:55 +0100 Subject: Add pickaxe pickup --- src/map.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/map.c') diff --git a/src/map.c b/src/map.c index cf25426..d34a5a9 100644 --- a/src/map.c +++ b/src/map.c @@ -14,12 +14,6 @@ #include "map.h" -typedef enum -{ - Player = 0, - Snake, -} EntityType; - /* current map; set via map_init */ static const uint8_t *cmap; static uint8_t gold[MAP_W * MAP_H]; @@ -31,6 +25,7 @@ static void (* const init[])(Entity *) = bat_init, pickup_time_init, pickup_bonus_init, + pickup_pickaxe_init, }; void map_init(const uint8_t map[]) @@ -58,8 +53,8 @@ void map_init(const uint8_t map[]) ent += 4 ) { - /* the player is not part of the entity system */ - if (*ent == Player) + /* the player (entity 0) is not part of the entity system */ + if (*ent == 0) { player_init(ent[1] * MAP_TILE_W, ent[2] * MAP_TILE_H, ent[3] & 1); continue; -- cgit v1.2.3