From d489b6ef92ae9f61bbceb5f594026a51e71538f2 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Tue, 20 Jun 2023 22:31:57 +0100 Subject: Add gold support - added gold layer to the map - the player can collect gold - updates the score - TODO: end of stage --- src/player.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/player.c') diff --git a/src/player.c b/src/player.c index 1528337..4fe916e 100644 --- a/src/player.c +++ b/src/player.c @@ -4,6 +4,7 @@ #include "vga.h" #include "map.h" #include "data.h" +#include "game.h" #include "player.h" @@ -189,6 +190,9 @@ void player_update() delay = 0; frame = FRAME_STANDING; } + + if (map_update_gold(x + (dir == DIR_LEFT ? 7 : 8), y + 15)) + add_score(10); } void player_erase() -- cgit v1.2.3