ootw: make beast run

This commit is contained in:
Vince Weaver 2019-03-25 00:12:09 -04:00
parent 4905a1dd05
commit 554d7f48b2
5 changed files with 127 additions and 9 deletions

View File

@ -1,12 +1,44 @@
;=======================================
; Setup Beast
; FIXME: distance for count should be related
; to X distance behind on previous screen
setup_beast:
lda BEAST_OUT
beq setup_no_beast
lda #30
sta BEAST_COUNT
lda #B_STANDING
sta BEAST_STATE
lda BEAST_DIRECTION
beq setup_beast_left
setup_beast_right:
lda #-8
sta BEAST_X
jmp setup_no_beast
setup_beast_left:
lda #41
sta BEAST_X
setup_no_beast:
rts
;======================================= ;=======================================
; Move Beast ; Move Beast
;
; FIXME: stop at edge of screen, or at physicist
move_beast: move_beast:
; lda PHYSICIST_STATE lda BEAST_STATE
; cmp #P_WALKING cmp #B_RUNNING
; beq move_physicist_walking beq move_beast_running
; cmp #P_RUNNING cmp #B_STANDING
; beq move_physicist_running beq move_beast_standing
rts rts
;====================== ;======================
@ -33,7 +65,17 @@ b_no_move_run:
; standing ; standing
move_beast_standing: move_beast_standing:
lda BEAST_COUNT
beq beast_stand_done ; if 0, perma-stand
dec BEAST_COUNT
bne beast_stand_done
lda #B_RUNNING
sta BEAST_STATE
beast_stand_done:
rts
;====================================== ;======================================
; draw beast ; draw beast
@ -74,10 +116,10 @@ b_running:
bcc brun_gait_fine ; blt bcc brun_gait_fine ; blt
lda #0 lda #0
sta GAIT sta BEAST_GAIT
brun_gait_fine: brun_gait_fine:
lsr ; lsr
and #$fe and #$fe
tax tax

View File

@ -107,9 +107,16 @@ cave_setup_done:
sta GAIT sta GAIT
sta GAME_OVER sta GAME_OVER
jsr setup_beast
;============================
;============================
;============================ ;============================
; Cavern Loop (not a palindrome) ; Cavern Loop (not a palindrome)
;============================ ;============================
;============================
;============================
cavern_loop: cavern_loop:
;========================== ;==========================
@ -134,12 +141,30 @@ cavern_loop:
jsr check_screen_limit jsr check_screen_limit
;=============== ;===============
; draw physicist ; draw physicist
jsr draw_physicist jsr draw_physicist
;================
; handle beast
lda BEAST_OUT
beq cavern_no_beast
;================
; move beast
jsr move_beast
;================
; draw beast
jsr draw_beast
cavern_no_beast:
just_slugs: just_slugs:
;=============== ;===============

View File

@ -173,7 +173,7 @@ beyond_mesa_normal:
beq mesa_no_beast beq mesa_no_beast
;================ ;================
; draw beast ; move beast
jsr move_beast jsr move_beast
@ -254,6 +254,9 @@ trigger_beast:
sta GAME_OVER sta GAME_OVER
sta PHYSICIST_STATE ; stop in tracks sta PHYSICIST_STATE ; stop in tracks
lda #50
sta BEAST_COUNT
lda #30 lda #30
sta BEAST_X sta BEAST_X

View File

@ -82,9 +82,15 @@ beast_in:
lda #30 lda #30
sta TENTACLE_PROGRESS sta TENTACLE_PROGRESS
jsr setup_beast
;============================
;============================
;============================ ;============================
; Pool Loop (palindrome) ; Pool Loop (palindrome)
;============================ ;============================
;============================
;============================
pool_loop: pool_loop:
;================================ ;================================
@ -288,6 +294,24 @@ no_tentacle:
jsr draw_physicist jsr draw_physicist
;================
; handle beast
lda BEAST_OUT
beq pool_no_beast
;================
; move beast
jsr move_beast
;================
; draw beast
jsr draw_beast
pool_no_beast:
beyond_tentacles: beyond_tentacles:

View File

@ -69,9 +69,13 @@ load_swing_bg:
sta GAIT sta GAIT
sta GAME_OVER sta GAME_OVER
jsr setup_beast
;============================
;============================ ;============================
; Rope Loop ; Rope Loop
;============================ ;============================
;============================
rope_loop: rope_loop:
;============================ ;============================
@ -136,6 +140,26 @@ beyond_quake:
jsr check_screen_limit jsr check_screen_limit
;================
; handle beast
lda BEAST_OUT
beq rope_no_beast
;================
; move beast
jsr move_beast
;================
; draw beast
jsr draw_beast
rope_no_beast:
;=============================== ;===============================
; check if swinging off ; check if swinging off