diff options
author | Juan J. Martinez <jjm@usebox.net> | 2023-06-20 22:31:57 +0100 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2023-06-20 22:31:57 +0100 |
commit | d489b6ef92ae9f61bbceb5f594026a51e71538f2 (patch) | |
tree | f0bb53c68f5f8bd6fc4e3df97a5016a8e58224cf /src/player.c | |
parent | 8ad4c1aa98144a1799f340a44c80a0e461ced683 (diff) | |
download | gold-mine-run-d489b6ef92ae9f61bbceb5f594026a51e71538f2.tar.gz gold-mine-run-d489b6ef92ae9f61bbceb5f594026a51e71538f2.zip |
Add gold support
- added gold layer to the map
- the player can collect gold
- updates the score
- TODO: end of stage
Diffstat (limited to 'src/player.c')
-rw-r--r-- | src/player.c | 4 |
1 files changed, 4 insertions, 0 deletions
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() |