ootw: more work on beast behavior

This commit is contained in:
Vince Weaver 2019-03-26 23:12:44 -04:00
parent e27fdac9a4
commit 9264a085a7
4 changed files with 49 additions and 0 deletions

View File

@ -44,6 +44,40 @@ move_beast:
;======================
; running
move_beast_running:
;=======================
; stop at edge or at physicist
lda BEAST_DIRECTION
beq check_beast_left
check_beast_right:
clc
lda BEAST_X
adc #$80
cmp RIGHT_LIMIT
bcc beast_no_stop ; (blt==bcc)
bcs stop_beast
check_beast_left:
clc
lda BEAST_X
adc #$80
cmp LEFT_LIMIT
bcs beast_no_stop ; (bge==bcs)
stop_beast:
lda #B_STANDING
sta BEAST_STATE
rts
beast_no_stop:
inc BEAST_GAIT ; cycle through animation
lda BEAST_GAIT

View File

@ -80,6 +80,8 @@ left_going_left:
beq walk_left
cmp #P_WALKING
beq run_left
cmp #P_CROUCHING
beq stand_left
;=============================
; already running, do nothing?
@ -93,6 +95,8 @@ left_going_right:
beq stand_right
cmp #P_STANDING
beq stand_left
cmp #P_CROUCHING
beq stand_left
;===========================
; otherwise?
@ -124,6 +128,8 @@ right_going_right:
beq walk_right
cmp #P_WALKING
beq run_right
cmp #P_CROUCHING
beq stand_right
;=============================
; already running, do nothing?
@ -137,6 +143,8 @@ right_going_left:
beq stand_left
cmp #P_STANDING
beq stand_right
cmp #P_CROUCHING
beq stand_left
;===========================
; otherwise?

View File

@ -60,6 +60,8 @@ mesa_left:
sta GAME_OVER
sta LEVELEND_PROGRESS
jsr setup_beast
;============================
;============================
;============================

View File

@ -306,10 +306,15 @@ check_swung_off:
cmp #$5
bne not_done_rope
;==========================
; swung off screen to right
lda #1
sta PHYSICIST_X
sta EARTH_OFFSET
sta DIRECTION ; face right
sta BEAST_DIRECTION
lda #10
sta PHYSICIST_Y
lda #P_FALLING