mist: stoney: compass puzzle sorta hooked up

This commit is contained in:
Vince Weaver 2020-08-07 00:50:44 -04:00
parent dcec7fa124
commit 58678e434b
7 changed files with 85 additions and 8 deletions

View File

@ -17,13 +17,12 @@ For release 1.0
-- load 1s clip of sounds (4k each) into language card?
+ STONEY
-- proper crawlway exits if we have space
-- have lights off mean darken the levels
-- have lights come on in telescope view
-- allow coming at steps from an angle
-- allow clicking on tunnel to get there
-- hook up compass rose
-- if space allows, lighten floor of compass rose when
right button pressed
-- hook up pump
-- hook up key/trunk puzzle

View File

@ -109,7 +109,7 @@
.byte $00 ; SHIP_RAISED = $AF
; stoneship
.byte $00 ; PUMP_STATE = $B0
.byte $07 ; BATTERY_CHARGE = $B1
.byte $00 ; BATTERY_CHARGE = $B1
.byte $00 ; COMPASS_STATE = $B2
.byte $00 ; CRANK_ANGLE = $B3
.byte $00 ; WHITE_PAGE_TAKEN = $B4

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

View File

@ -659,7 +659,7 @@ location35:
.byte DIRECTION_W
.byte 6,35 ; special x
.byte 0,46 ; special y
.word view_compass_right-1 ; special function
.word compass_puzzle-1 ; special function
; STONEY_RIGHT_TUNNEL1 -- right tunnel to blue room
location36:
@ -862,7 +862,7 @@ location46:
.byte DIRECTION_W
.byte 6,35 ; special x
.byte 0,46 ; special y
.word view_compass_right-1 ; special function
.word compass_puzzle-1 ; special function
; STONEY_CRAWLWAY_ENTRANCE_LEFT -- left_crawlway_entrance

View File

@ -36,6 +36,8 @@ stoney_start:
sta LEVEL_OVER
; resets if you leave
; FIXME: temp debug
lda #$7
sta BATTERY_CHARGE
; init cursor
@ -71,6 +73,9 @@ game_loop:
;====================================
; turn lights off (if applicable)
;====================================
lda COMPASS_STATE
bne dont_touch_lights
lda LOCATION
cmp #STONEY_BOOK_STAIRS1
beq turn_off_the_lights
@ -308,7 +313,10 @@ stoney_half_message:
.include "stoney_puzzles.s"
.include "handle_pages.s"
.include "lights_off.s"
.include "simple_sounds.s"
; level data
.include "leveldata_stoney.inc"
.include "lights_off.s"

View File

@ -60,7 +60,74 @@
;==================================
; compass puzzle
;==================================
; want to click on 135 degrees
; turns on lights (sets COMPASS_STATE to 1), runs update_compas_state
; click on other pins
; turns off lights, shorts out power
; COMPASS_STATE to 0
; BATTERY_CHARGE to 0
; also puzzle only works if battery charge is > 0
; to keep you from pressing all in dark
compass_puzzle:
lda BATTERY_CHARGE
beq compass_oob
lda CURSOR_Y
cmp #7
bcc check_top ; blt
cmp #38
bcs check_bottom ; bge
check_middle:
lda CURSOR_X
cmp #6
bcc compass_oob
cmp #12
bcc wrong_knob
cmp #28
bcc compass_oob
cmp #35
bcs compass_oob
lda CURSOR_Y
cmp #32
bcs right_knob
bcc wrong_knob
check_top:
lda CURSOR_X
cmp #10
bcc compass_oob
cmp #30
bcs compass_oob
bcc wrong_knob
check_bottom:
lda CURSOR_X
cmp #13
bcc compass_oob
cmp #28
bcs compass_oob
bcc wrong_knob
right_knob:
jsr click_speaker
lda #1
sta COMPASS_STATE
jmp update_compass_state
wrong_knob:
lda #0
sta COMPASS_STATE
sta BATTERY_CHARGE
jsr long_beep
jmp update_compass_state
compass_oob:
rts
@ -178,7 +245,7 @@ goto_left_tunnel:
goto_compass_right:
lda #DIRECTION_W
lda #DIRECTION_W|DIRECTION_ONLY_POINT
sta DIRECTION
lda #STONEY_COMPASS_ROSE_RIGHT
@ -207,6 +274,9 @@ goto_right_tunnel:
goto_compass_left:
lda #DIRECTION_W|DIRECTION_ONLY_POINT
sta DIRECTION
lda #STONEY_COMPASS_ROSE_LEFT
sta LOCATION