mist: meche: elevator works

This commit is contained in:
Vince Weaver 2020-03-22 10:36:19 -04:00
parent 1c2b19a8fd
commit 8f27b865ac
3 changed files with 110 additions and 62 deletions

View File

@ -145,19 +145,17 @@ MECHE_RIGHT_HALL_CORNER = 22
MECHE_BLUE_ROOM_CENTER = 23
MECHE_CENTER_HALL2 = 24
MECHE_ELEVATOR_PATH = 25
MECHE_ELEVATOR_GROUND = 26
MECHE_ELEVATOR_HALF = 27
MECHE_ELEVATOR_TOP = 28
MECHE_TOP_FLOOR = 29
MECHE_ROTATE_CONTROLS = 30
MECHE_EAST_PLATFORM = 31
MECHE_EAST_ARCH = 32
MECHE_EAST_TOP = 33
MECHE_EAST_HINT = 34
MECHE_EXIT_PUZZLE = 35
MECHE_MIST_BOOK = 36
MECHE_MIST_CLOSED = 37
MECHE_MIST_OPEN = 38
MECHE_IN_ELEVATOR = 26
MECHE_TOP_FLOOR = 27
MECHE_ROTATE_CONTROLS = 28
MECHE_EAST_PLATFORM = 29
MECHE_EAST_ARCH = 30
MECHE_EAST_TOP = 31
MECHE_EAST_HINT = 32
MECHE_EXIT_PUZZLE = 33
MECHE_MIST_BOOK = 34
MECHE_MIST_CLOSED = 35
MECHE_MIST_OPEN = 36

View File

@ -12,7 +12,7 @@ locations:
.word location20,location21,location22,location23
.word location24,location25,location26,location27
.word location28,location29,location30,location31
.word location32,location33,location34
.word location32
; MECHE_INSIDE_GEAR -- Inside gear on Mist
location0:
@ -461,11 +461,11 @@ location25:
.byte $ff ; north exit
.byte $ff ; south exit
.byte MECHE_RED_BUTTON ; east exit
.byte MECHE_ELEVATOR_GROUND ; west exit
.byte MECHE_IN_ELEVATOR ; west exit
.byte $ff ; north exit_dir
.byte $ff ; south exit_dir
.byte DIRECTION_E ; east exit_dir
.byte DIRECTION_E ; west exit_dir
.byte DIRECTION_E|DIRECTION_ONLY_POINT ; west exit_dir
.word $0000 ; north bg
.word $0000 ; south bg
.word elevator_path_e_lzsa ; east bg
@ -473,7 +473,7 @@ location25:
.byte BG_WEST|BG_EAST
.byte $ff ; special exit
; MECHE_ELEVATOR_GROUND -- elevator ground floor
; MECHE_IN_ELEVATOR -- elevator (ground floor default)
location26:
.byte $ff ; north exit
.byte $ff ; south exit
@ -488,52 +488,21 @@ location26:
.word elevator_ground_e_lzsa ; east bg
.word $0000 ; west bg
.byte BG_EAST
.byte $ff ; special exit
.byte DIRECTION_E ; special exit
.byte 1,12 ; special x
.byte 14,30 ; special y
.word elevator_button-1 ; special function
; MECHE_ELEVATOR_HALF -- elevator halfway
; MECHE_TOP_FLOOR -- elevator top floor
location27:
.byte $ff ; north exit
.byte $ff ; south exit
.byte $ff ; east exit
.byte $ff ; west exit
.byte $ff ; north exit_dir
.byte $ff ; south exit_dir
.byte DIRECTION_E ; east exit_dir
.byte $0000 ; west exit_dir
.word $0000 ; north bg
.word $0000 ; south bg
.word elevator_half_e_lzsa ; east bg
.word $0000 ; west bg
.byte BG_EAST
.byte $ff ; special exit
; MECHE_ELEVATOR_TOP -- elevator top
location28:
.byte $ff ; north exit
.byte $ff ; south exit
.byte MECHE_TOP_FLOOR ; east exit
.byte $ff ; west exit
.byte $ff ; north exit_dir
.byte $ff ; south exit_dir
.byte DIRECTION_E ; east exit_dir
.byte $0000 ; west exit_dir
.word $0000 ; north bg
.word $0000 ; south bg
.word elevator_top_e_lzsa ; east bg
.word $0000 ; west bg
.byte BG_EAST
.byte $ff ; special exit
; MECHE_TOP_FLOOR -- elevator top floor
location29:
.byte $ff ; north exit
.byte $ff ; south exit
.byte MECHE_TOP_FLOOR ; east exit
.byte MECHE_ELEVATOR_TOP ; west exit
.byte MECHE_IN_ELEVATOR ; west exit
.byte $ff ; north exit_dir
.byte $ff ; south exit_dir
.byte DIRECTION_W ; east exit_dir
.byte DIRECTION_E ; west exit_dir
.byte DIRECTION_E|DIRECTION_ONLY_POINT ; west exit_dir
.word $0000 ; north bg
.word $0000 ; south bg
.word top_floor_e_lzsa ; east bg
@ -542,15 +511,15 @@ location29:
.byte $ff ; special exit
; MECHE_ROTATE_CONTROLS -- elevator rotate controls
location30:
location28:
.byte $ff ; north exit
.byte $ff ; south exit
.byte MECHE_TOP_FLOOR ; east exit
.byte MECHE_ELEVATOR_TOP ; west exit
.byte MECHE_IN_ELEVATOR ; west exit
.byte $ff ; north exit_dir
.byte $ff ; south exit_dir
.byte DIRECTION_W ; east exit_dir
.byte DIRECTION_E ; west exit_dir
.byte DIRECTION_E|DIRECTION_ONLY_POINT ; west exit_dir
.word $0000 ; north bg
.word $0000 ; south bg
.word rotate_controls_e_lzsa ; east bg
@ -560,7 +529,7 @@ location30:
; MECHE EAST_PLATFORM -- rotated to east platform
location31:
location29:
.byte $ff ; north exit
.byte $ff ; south exit
.byte MECHE_EAST_ARCH ; east exit
@ -577,7 +546,7 @@ location31:
.byte $ff ; special exit
; MECHE EAST_ARCH -- cool archway
location32:
location30:
.byte $ff ; north exit
.byte MECHE_EAST_TOP ; south exit
.byte $ff ; east exit
@ -594,7 +563,7 @@ location32:
.byte $ff ; special exit
; MECHE EAST_TOP -- top of the world
location33:
location31:
.byte $ff ; north exit
.byte $ff ; south exit
.byte MECHE_EAST_HINT ; east exit
@ -611,7 +580,7 @@ location33:
.byte $ff ; special exit
; MECHE EAST_HINT -- final hint
location34:
location32:
.byte $ff ; north exit
.byte $ff ; south exit
.byte MECHE_EAST_TOP ; east exit

View File

@ -4,6 +4,87 @@
;==================================
;==============================
; handle elevator button pushes
elevator_button:
lda CURSOR_Y
cmp #24
bcs elevator_goto_ground
cmp #20
bcs elevator_goto_half
elevator_goto_top:
; set exit to top floor
ldy #LOCATION_EAST_EXIT
lda #MECHE_TOP_FLOOR
sta location26,Y
; set bg to top-floor backround
ldy #LOCATION_EAST_BG
lda #<elevator_top_e_lzsa
sta location26,Y
lda #>elevator_top_e_lzsa
jmp elevator_button_done
elevator_goto_ground:
; set exit to top floor
ldy #LOCATION_EAST_EXIT
lda #MECHE_ELEVATOR_PATH
sta location26,Y
; set bg to top-floor backround
ldy #LOCATION_EAST_BG
lda #<elevator_ground_e_lzsa
sta location26,Y
lda #>elevator_ground_e_lzsa
jmp elevator_button_done
elevator_goto_half:
; set exit to top floor
ldy #LOCATION_EAST_EXIT
lda #$ff
sta location26,Y
; set bg to half-floor backround
ldy #LOCATION_EAST_BG
lda #<elevator_half_e_lzsa
sta location26,Y
lda #>elevator_half_e_lzsa
jmp elevator_button_done
elevator_goto_controls:
elevator_button_done:
sta location26+1,Y
jsr change_location ; tail call?
rts
;=================
; elevator panel clicked