mist: channelwood: can raise the pipe

This commit is contained in:
Vince Weaver 2020-06-15 00:36:55 -04:00
parent 3e7be76227
commit d69e65def5
11 changed files with 111 additions and 8 deletions

View File

@ -39,8 +39,10 @@ channel_start:
lda #0
sta ANIMATE_FRAME
; FIXME
; handle gear visibility
; set up bridges
jsr adjust_after_changes
game_loop:
;=================

View File

@ -31,6 +31,36 @@ no_raise_bridge:
;=======================
; extend_pipe
; TODO: can you unextend in game?
; TODO: can you unextend if water flowing?
extend_pipe:
bit $C030 ; click speaker
; only extend pipe
lda CHANNEL_SWITCHES
ora #CHANNEL_PIPE_EXTENDED
sta CHANNEL_SWITCHES
jsr adjust_after_changes
jsr change_location
no_extend_pipe:
rts
;======================================
; adjust after changes
;======================================
; should call this when entering level
adjust_after_changes:
@ -74,8 +104,53 @@ bridge_is_down:
sta location16,Y ; CHANNEL_BRIDGE
adjust_pipe:
;=======================
; extend pipe or not
lda CHANNEL_SWITCHES
and #CHANNEL_PIPE_EXTENDED
beq pipe_stowed
pipe_extended:
; change to pipe_extend bg
ldy #LOCATION_SOUTH_BG
lda #<pipe_extend_up_s_lzsa
sta location40,Y ; CHANNEL_PIPE_EXTEND
lda #>pipe_extend_up_s_lzsa
sta location40+1,Y ; CHANNEL_PIPE_EXTEND
; also change for other side of bridge
ldy #LOCATION_WEST_BG
lda #<pipe_bridge2_up_w_lzsa
sta location23,Y ; CHANNEL_PIPE_BRIDGE2
lda #>pipe_bridge2_up_w_lzsa
sta location23+1,Y ; CHANNEL_PIPE_BRIDGE2
jmp done_adjust_changes
pipe_stowed:
; change to pipe_extend bg
ldy #LOCATION_SOUTH_BG
lda #<pipe_extend_down_s_lzsa
sta location40,Y ; CHANNEL_PIPE_EXTEND
lda #>pipe_extend_down_s_lzsa
sta location40+1,Y ; CHANNEL_PIPE_EXTEND
; also change for other side of bridge
ldy #LOCATION_WEST_BG
lda #<pipe_bridge2_w_lzsa
sta location23,Y ; CHANNEL_PIPE_BRIDGE2
lda #>pipe_bridge2_w_lzsa
sta location23+1,Y ; CHANNEL_PIPE_BRIDGE2
done_adjust_changes:
rts

View File

@ -349,3 +349,4 @@ CHANNEL_OUT_BACK = 36
CHANNEL_AFTER_BRIDGE1 = 37
CHANNEL_AFTER_BRIDGE2 = 38
CHANNEL_BOOK_FORK = 39
CHANNEL_PIPE_EXTEND = 40

View File

@ -31,7 +31,7 @@ channel_graphics.inc: \
path6_s.lzsa path6_w.lzsa path6_n.lzsa \
fork_n.lzsa fork_s.lzsa fork_w.lzsa \
before_elev1_e.lzsa before_elev1_w.lzsa \
pipe_bridge2_w.lzsa pipe_bridge2_e.lzsa \
pipe_bridge2_up_w.lzsa pipe_bridge2_w.lzsa pipe_bridge2_e.lzsa \
elevator1_open.lzsa \
steps_fork_n.lzsa steps_fork_s.lzsa steps_fork_w.lzsa \
steps_path_e.lzsa steps_path_w.lzsa \
@ -47,7 +47,8 @@ channel_graphics.inc: \
outback_n.lzsa outback_s.lzsa \
after_bridge1_e.lzsa after_bridge1_w.lzsa \
after_bridge2_e.lzsa after_bridge2_w.lzsa \
book_fork_n.lzsa book_fork_s.lzsa book_fork_w.lzsa
book_fork_n.lzsa book_fork_s.lzsa book_fork_w.lzsa \
pipe_extend_n.lzsa pipe_extend_down_s.lzsa pipe_extend_up_s.lzsa
echo "arrival_n_lzsa: .incbin \"arrival_n.lzsa\"" > channel_graphics.inc
echo "arrival_s_lzsa: .incbin \"arrival_s.lzsa\"" >> channel_graphics.inc
echo "clearing_e_lzsa: .incbin \"clearing_e.lzsa\"" >> channel_graphics.inc
@ -96,6 +97,7 @@ channel_graphics.inc: \
echo "before_elev1_w_lzsa: .incbin \"before_elev1_w.lzsa\"" >> channel_graphics.inc
echo "pipe_bridge2_e_lzsa: .incbin \"pipe_bridge2_e.lzsa\"" >> channel_graphics.inc
echo "pipe_bridge2_w_lzsa: .incbin \"pipe_bridge2_w.lzsa\"" >> channel_graphics.inc
echo "pipe_bridge2_up_w_lzsa: .incbin \"pipe_bridge2_up_w.lzsa\"" >> channel_graphics.inc
echo "elevator1_open_lzsa: .incbin \"elevator1_open.lzsa\"" >> channel_graphics.inc
echo "steps_fork_n_lzsa: .incbin \"steps_fork_n.lzsa\"" >> channel_graphics.inc
echo "steps_fork_s_lzsa: .incbin \"steps_fork_s.lzsa\"" >> channel_graphics.inc
@ -130,7 +132,9 @@ channel_graphics.inc: \
echo "book_fork_n_lzsa: .incbin \"book_fork_n.lzsa\"" >> channel_graphics.inc
echo "book_fork_s_lzsa: .incbin \"book_fork_s.lzsa\"" >> channel_graphics.inc
echo "book_fork_w_lzsa: .incbin \"book_fork_w.lzsa\"" >> channel_graphics.inc
echo "pipe_extend_n_lzsa: .incbin \"pipe_extend_n.lzsa\"" >> channel_graphics.inc
echo "pipe_extend_up_s_lzsa: .incbin \"pipe_extend_up_s.lzsa\"" >> channel_graphics.inc
echo "pipe_extend_down_s_lzsa: .incbin \"pipe_extend_down_s.lzsa\"" >> channel_graphics.inc
%.gr: %.png
$(PNG2GR) $< $@

Binary file not shown.

Before

Width:  |  Height:  |  Size: 982 B

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 944 B

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

View File

@ -13,7 +13,7 @@ locations:
.word location28,location29,location30,location31
.word location32,location33,location34,location35
.word location36,location37,location38,location39
.word location40
; CHANNEL_OUTSIDE_CABIN -- outside in clearing
location0:
@ -708,11 +708,11 @@ location38:
; CHANNEL_BOOK_FORK -- fork to book elevator
location39:
.byte $ff ; north exit
.byte $ff ; south exit
.byte CHANNEL_PIPE_EXTEND ; south exit
.byte $ff ; east exit
.byte CHANNEL_AFTER_BRIDGE2 ; west exit
.byte $ff ; north exit_dir
.byte $ff ; south exit_dir
.byte DIRECTION_S ; south exit_dir
.byte $ff ; east exit_dir
.byte DIRECTION_W ; west exit_dir
.word book_fork_n_lzsa ; north bg
@ -722,3 +722,24 @@ location39:
.byte BG_NORTH|BG_SOUTH|BG_WEST
.byte $ff
; CHANNEL_PIPE_EXTEND -- pipe extender
location40:
.byte CHANNEL_BOOK_FORK ; north exit
.byte $ff ; south exit
.byte $ff ; east exit
.byte $ff ; west exit
.byte DIRECTION_N ; north exit_dir
.byte $ff ; south exit_dir
.byte $ff ; east exit_dir
.byte $ff ; west exit_dir
.word pipe_extend_n_lzsa ; north bg
.word pipe_extend_down_s_lzsa ; south bg
.word $0000 ; east bg
.word $0000 ; west bg
.byte BG_NORTH|BG_SOUTH
.byte DIRECTION_S ; special exit
.byte 17,24 ; special x
.byte 34,40 ; special y
.word extend_pipe-1 ; special function