From: Lukas Krickl Date: Wed, 6 Aug 2025 11:14:03 +0000 (+0200) Subject: player: Added stub for door removal when the player enters it X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=f79716a4c873c6835815d4bec01438035e9300d0;p=gbrg%2F.git player: Added stub for door removal when the player enters it --- diff --git a/src/player.s b/src/player.s index d843ba0..d37cd0b 100644 --- a/src/player.s +++ b/src/player.s @@ -28,8 +28,12 @@ unit_player_update: ; check if the player is currently ; on a convered tile or not push de + + ; first read the current tile call unit_get_pos call map_get_tile + push af ; store for later use + ; a = tile flags and a, CF_COVERED ld b, a @@ -37,7 +41,13 @@ unit_player_update: and a, (~CF_COVERED) & 0xFF or a, b ld [player_rt_special_flags], a + pop af ; get back a for next check pop de + + ; check if player is on a door tile + ; if so, remove door and queue a map redraw + and a, CF_DOOR + call nz, unit_player_remove_door ; check for exit flags push de @@ -54,6 +64,15 @@ unit_player_update: ret + + ; removes the door tile the player is currently + ; standing on + ; inputs: + ; de: actor +unit_player_remove_door: + ; TODO: remove door tile, door flag + ; and redraw map + ret ; checks the current tile ; and checks for exit flags