mist: can actually take the tower elevator

This commit is contained in:
Vince Weaver 2020-04-03 17:16:23 -04:00
parent 8fb84c0e81
commit 6477e7234e
2 changed files with 53 additions and 6 deletions

View File

@ -351,8 +351,10 @@ location18:
.word $0000 ; east bg
.word $0000 ; west bg
.byte BG_SOUTH
.byte $ff
.byte DIRECTION_S ; special exit
.byte 29,35 ; special x
.byte 34,40 ; special y
.word elevator_button-1 ; special function
; OCTAGON_TOWER_BOOK -- tower, bookside
location19:
@ -390,12 +392,12 @@ location20:
; OCTAGON_BOOK_VIEW -- ladder, view outside
location21:
.byte $ff ; north exit
.byte OCTAGON_BOOK_LADDER ; south exit
.byte OCTAGON_BOOK_LADDER ; north exit
.byte $ff ; south exit
.byte $ff ; east exit
.byte $ff ; west exit
.byte $ff ; north exit_dir
.byte DIRECTION_S ; south exit_dir
.byte DIRECTION_N ; north exit_dir
.byte $ff ; south exit_dir
.byte $ff ; east exit_dir
.byte $ff ; west exit_dir
.word tower_book_view_n_lzsa ; north bg

View File

@ -1,4 +1,49 @@
; elevator button pressed
elevator_button:
; see which floor we are on
ldy #LOCATION_SOUTH_EXIT
lda location18,Y
cmp #OCTAGON_ELEVATOR_OUT
bne elevator_goto_library_level
elevator_goto_tower_level:
; we want to go up the tower
; change exit
lda #OCTAGON_TOWER_BOOK
sta location18,Y
; change bg image
ldy #LOCATION_SOUTH_BG
lda #<elevator_tower_s_lzsa
sta location18,Y
lda #>elevator_tower_s_lzsa
sta location18+1,Y
jmp change_location
elevator_goto_library_level:
; we want to move back to the library
; change exit
lda #OCTAGON_ELEVATOR_OUT
sta location18,Y
; change south bg image
ldy #LOCATION_SOUTH_BG
lda #<elevator_lib_s_lzsa
sta location18,Y
lda #>elevator_lib_s_lzsa
sta location18+1,Y
jmp change_location
open_bookshelf:
; change background of center room N