aboutsummaryrefslogtreecommitdiff
path: root/src/map.c
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-06-29 21:47:55 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-06-29 21:47:55 +0100
commit2d2379251e71b5f315235db7980d0cfe03132561 (patch)
tree346ddd8719753fa1470cb8dc7456328d033ebff1 /src/map.c
parent16fb9f0d5e5904cca7c256b63f20f1fc1466bd5e (diff)
downloadgold-mine-run-2d2379251e71b5f315235db7980d0cfe03132561.tar.gz
gold-mine-run-2d2379251e71b5f315235db7980d0cfe03132561.zip
Add pickaxe pickup
Diffstat (limited to 'src/map.c')
-rw-r--r--src/map.c11
1 files changed, 3 insertions, 8 deletions
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;