mist: nibel: close gate from other side

This commit is contained in:
Vince Weaver 2020-08-19 11:08:02 -04:00
parent 034d7d5637
commit e750f653b6
4 changed files with 72 additions and 17 deletions

View File

@ -18,6 +18,7 @@ nibel_graphics.inc: \
blue_path_2p25_open_e.lzsa \
blue_path_2p25_gate_s.lzsa \
blue_path_2p5_n.lzsa blue_path_2p5_s.lzsa \
blue_path_2p5_gate_n.lzsa \
blue_path_2p75_n.lzsa blue_path_2p75_s.lzsa \
blue_path3_n.lzsa blue_path3_s.lzsa \
blue_house_door_n.lzsa blue_house_door_s.lzsa blue_house_door_open_s.lzsa \
@ -53,6 +54,7 @@ nibel_graphics.inc: \
echo "blue_path_2p25_gate_s_lzsa: .incbin \"blue_path_2p25_gate_s.lzsa\"" >> nibel_graphics.inc
echo "blue_path_2p5_n_lzsa: .incbin \"blue_path_2p5_n.lzsa\"" >> nibel_graphics.inc
echo "blue_path_2p5_s_lzsa: .incbin \"blue_path_2p5_s.lzsa\"" >> nibel_graphics.inc
echo "blue_path_2p5_gate_n_lzsa: .incbin \"blue_path_2p5_gate_n.lzsa\"" >> nibel_graphics.inc
echo "blue_path_2p75_n_lzsa: .incbin \"blue_path_2p75_n.lzsa\"" >> nibel_graphics.inc
echo "blue_path_2p75_s_lzsa: .incbin \"blue_path_2p75_s.lzsa\"" >> nibel_graphics.inc
echo "blue_path3_n_lzsa: .incbin \"blue_path3_n.lzsa\"" >> nibel_graphics.inc

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -402,7 +402,11 @@ location20:
.word $0000 ; east bg
.word $0000 ; west bg
.byte BG_NORTH|BG_SOUTH
.byte $ff
.byte DIRECTION_N ; special exit
.byte 11,17 ; special x
.byte 0,46 ; special y
.word touch_gate_n-1 ; special function
; NIBEL_BLUE_PATH_2P75 -- path 2.75 along the wall
location21:

View File

@ -1,4 +1,52 @@
touch_gate_n:
lda #2
sta ANIMATE_FRAME
rts
update_gate_n:
lda ANIMATE_FRAME
beq open_gate_n
bne close_gate_n
open_gate_n:
ldy #LOCATION_NORTH_BG
lda location20,Y ; NIBEL_BLUE_PATH_2P5
cmp #<blue_path_2p5_n_lzsa
beq done_open_gate_n ; see if already open
lda #<blue_path_2p5_n_lzsa
sta location20,Y ; NIBEL_BLUE_PATH_2P5
lda #>blue_path_2p5_n_lzsa
sta location20+1,Y ; NIBEL_BLUE_PATH_2P5
jsr change_direction
done_open_gate_n:
rts
close_gate_n:
ldy #LOCATION_NORTH_BG
lda location20,Y ; NIBEL_BLUE_PATH_2P5
cmp #<blue_path_2p5_gate_n_lzsa
beq done_close_gate_n ; see if already closed
lda #<blue_path_2p5_gate_n_lzsa
sta location20,Y ; NIBEL_BLUE_PATH_2P5
lda #>blue_path_2p5_gate_n_lzsa
sta location20+1,Y ; NIBEL_BLUE_PATH_2P5
jsr change_direction
done_close_gate_n:
lda FRAMEL
and #$3f
bne really_done_close_gate_n
dec ANIMATE_FRAME
really_done_close_gate_n:
rts
update_gate_s:
@ -54,27 +102,28 @@ really_done_close_gate_s:
draw_gate_animation_s:
lda DIRECTION
cmp #DIRECTION_S
bne done_gate_s
lda ANIMATE_FRAME
beq done_gate_s
;draw_gate_animation_s:
; lda DIRECTION
; cmp #DIRECTION_S
; bne done_gate_s
done_gate_s:
rts
; lda ANIMATE_FRAME
; beq done_gate_s
draw_gate_animation_n:
lda DIRECTION
cmp #DIRECTION_N
bne done_gate_n
;done_gate_s:
; rts
lda ANIMATE_FRAME
beq done_gate_n
;draw_gate_animation_n:
; lda DIRECTION
; cmp #DIRECTION_N
; bne done_gate_n
done_gate_n:
rts
; lda ANIMATE_FRAME
; beq done_gate_n
;done_gate_n:
; rts
;=================================