From 17cc990e5a10142217c34c38dd2da47f87a8c609 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Fri, 18 Jan 2019 00:27:32 -0500 Subject: [PATCH] ootw: add falling boulder --- ootw/ootw.s | 3 +++ ootw/ootw_cavern.s | 31 +++++++++++++++++++++++++++++++ ootw/ootw_sprites.inc | 7 +++++++ ootw/zp.inc | 2 ++ 4 files changed, 43 insertions(+) diff --git a/ootw/ootw.s b/ootw/ootw.s index 01de826c..1be8f57f 100644 --- a/ootw/ootw.s +++ b/ootw/ootw.s @@ -23,6 +23,9 @@ ootw: lda #1 sta DIRECTION + lda #40 + sta BOULDER_Y + jsr ootw_pool ;=========================== diff --git a/ootw/ootw_cavern.s b/ootw/ootw_cavern.s index 00f9a4d4..77073e88 100644 --- a/ootw/ootw_cavern.s +++ b/ootw/ootw_cavern.s @@ -94,6 +94,16 @@ earthquake_init: lda #200 sta EQUAKE_PROGRESS + lda #0 + sta BOULDER_Y + jsr random16 + lda SEEDL + and #$1f + clc + adc #4 + sta BOULDER_X + + earth_mover: lda EQUAKE_PROGRESS beq earth_still @@ -144,7 +154,28 @@ done_shake: ;====================== ; draw falling boulders + lda BOULDER_Y + cmp #38 + bpl no_boulder + 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 diff --git a/ootw/ootw_sprites.inc b/ootw/ootw_sprites.inc index 4b9bebc7..e7138249 100644 --- a/ootw/ootw_sprites.inc +++ b/ootw/ootw_sprites.inc @@ -361,6 +361,13 @@ caught8: .byte $aa,$aa,$aa,$aa .byte $aa,$aa,$aa,$5e + ;============================ + ; Falling boulder + +boulder: + .byte $3,$2 + .byte $22,$22,$2a + .byte $22,$22,$22 diff --git a/ootw/zp.inc b/ootw/zp.inc index 4971671e..559ec245 100644 --- a/ootw/zp.inc +++ b/ootw/zp.inc @@ -138,6 +138,8 @@ HGR_COLOR = $E4 GAME_OVER = $E5 EQUAKE_PROGRESS = $E6 EARTH_OFFSET = $E7 +BOULDER_X = $E8 +BOULDER_Y = $E9 ;SHIPY = $E4 ;YADD = $E5 ;LOOP = $E6