ootw: have earthquake/boulders happen in rope room

This commit is contained in:
Vince Weaver 2019-01-20 01:54:58 -05:00
parent 166572a023
commit f25d152e20
3 changed files with 47 additions and 24 deletions

View File

@ -60,3 +60,32 @@ done_shake:
rts
;======================
; draw falling boulders
draw_boulder:
lda BOULDER_Y
cmp #38
bpl no_boulder
lda #<boulder
sta INL
lda #>boulder
sta INH
lda BOULDER_X
sta XPOS
lda BOULDER_Y
sta YPOS
jsr put_sprite
lda FRAMEL
and #$3
bne no_boulder
inc BOULDER_Y
inc BOULDER_Y
no_boulder:
rts

View File

@ -189,28 +189,8 @@ just_slugs:
;======================
; draw falling boulders
lda BOULDER_Y
cmp #38
bpl no_boulder
jsr draw_boulder
lda #<boulder
sta INL
lda #>boulder
sta INH
lda BOULDER_X
sta XPOS
lda BOULDER_Y
sta YPOS
jsr put_sprite
lda FRAMEL
and #$3
bne no_boulder
inc BOULDER_Y
inc BOULDER_Y
no_boulder:
;=======================
; page flip

View File

@ -38,8 +38,13 @@ ootw_rope:
sta GBASL
jsr load_rle_gr
;================================
; Load quake background to $1000
jsr gr_make_quake
;=================================
; copy to both pages $400/$800
; copy $c00 to both pages $400/$800
jsr gr_copy_to_current
jsr page_flip
@ -59,9 +64,9 @@ ootw_rope:
rope_loop:
;================================
; copy background to current page
; handle earthquakes
jsr gr_copy_to_current
jsr earthquake_handler
;===============================
@ -87,10 +92,18 @@ rope_loop:
lda #30
sta XPOS
lda #30
sec
sbc EARTH_OFFSET
sta YPOS
jsr put_sprite
;================
; draw falling boulder
jsr draw_boulder
;===============
; page flip
@ -119,6 +132,7 @@ rope_frame_no_oflo:
lda #0
sta PHYSICIST_X
sta EARTH_OFFSET
jmp ootw_pool