From: Lukas Krickl Date: Sun, 15 Dec 2024 18:41:27 +0000 (+0100) Subject: Added notes for room transitions X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=6ce1ffecc3f4de3dfffa832402d64b8e3665e68e;p=gbrg%2F.git Added notes for room transitions --- diff --git a/TODO.md b/TODO.md index 25a1624..64a9e5e 100644 --- a/TODO.md +++ b/TODO.md @@ -23,3 +23,11 @@ - If direction is already taken, try again - If it fails after 4 tries advance to a new room and try again - Do this until all rooms are filled + +## Room transition + +When a player hits the edge of the map a room transition should start. +A player can either go north, west, east or south. +The target room of a transition should be stored in a room exit table. +When a transition happens the state of the previous room should be written back to sram (e.g. actor table). +If possible make the animation smooth instead of simply blanking the screen. diff --git a/src/map.s b/src/map.s index 9ccc926..4233cf4 100644 --- a/src/map.s +++ b/src/map.s @@ -49,6 +49,13 @@ room_load_from: call room_load_actors ret + ; calls rom goto based on player position + ; inputs: + ; curr_room_exits: ptr to exits table + ; player_x/y: player position +room_goto_player_pos: + ld a, NORTH + ; transitions to a new room ; that is part of the map: ; inputs: @@ -307,7 +314,7 @@ room_get_flag_masked: ; exit table for empty exits room_empty_exits: -.db 0x00, 0x00 -.db 0x00, 0x00 -.db 0x00, 0x00 -.db 0x00, 0x00 +dw base_room_struct +dw base_room_struct +dw base_room_struct +dw base_room_struct