diff options
author | Juan J. Martinez <jjm@usebox.net> | 2023-06-29 21:47:55 +0100 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2023-06-29 21:47:55 +0100 |
commit | 2d2379251e71b5f315235db7980d0cfe03132561 (patch) | |
tree | 346ddd8719753fa1470cb8dc7456328d033ebff1 /src/map.c | |
parent | 16fb9f0d5e5904cca7c256b63f20f1fc1466bd5e (diff) | |
download | gold-mine-run-2d2379251e71b5f315235db7980d0cfe03132561.tar.gz gold-mine-run-2d2379251e71b5f315235db7980d0cfe03132561.zip |
Add pickaxe pickup
Diffstat (limited to 'src/map.c')
-rw-r--r-- | src/map.c | 11 |
1 files changed, 3 insertions, 8 deletions
@@ -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; |