ootw: finally implement run-jump

This commit is contained in:
Vince Weaver 2019-08-17 15:27:17 -04:00
parent 66074887ad
commit ee98df5689
3 changed files with 50 additions and 6 deletions

View File

@ -16,7 +16,13 @@
; if stand right, stand left
; if stand left, walk left
; if walk left, run left
; if up: if crouching, stand up
; if standing, jump
; if walking, jump
; if running, run-jump
; if down: if standing, crouch
; if walking, crouch
; if if running, slide-crouch
handle_keypress:
@ -240,11 +246,17 @@ up_not_elevator:
beq stand_up
cmp #P_CROUCH_SHOOTING
beq stand_up_shoot
cmp #P_RUNNING
beq run_jump
up_jump:
lda #P_JUMPING
jmp change_state_clear_gait
run_jump:
lda #P_JUMPING|STATE_RUNNING
jmp change_state_clear_gait
stand_up:
lda #P_STANDING
jmp change_state_clear_gait
@ -287,11 +299,14 @@ down_not_elevator:
cmp #P_SHOOTING
bne start_crouch
lda #P_CROUCH_SHOOTING
start_crouch_shoot:
and #STATE_RUNNING
ora #P_CROUCH_SHOOTING
jmp change_state_clear_gait
start_crouch:
lda #P_CROUCHING
and #STATE_RUNNING
ora #P_CROUCHING
jmp change_state_clear_gait

View File

@ -240,11 +240,24 @@ physicist_jumping:
cmp #32
bcc still_jumping ; blt
; done juming
lda #STATE_RUNNING
bit PHYSICIST_STATE
beq jump_to_stand
jump_to_run:
lda #0
sta GAIT
lda #P_RUNNING
sta PHYSICIST_STATE
jmp physicist_running
jump_to_stand:
lda #0
sta GAIT
lda #P_STANDING
sta PHYSICIST_STATE
jmp physicist_walking
jmp physicist_standing
still_jumping:
@ -261,10 +274,25 @@ still_jumping:
inc GAIT
lda #STATE_RUNNING
bit PHYSICIST_STATE
beq jump_change_x_regular
jump_change_x_running:
lda GAIT
; 1/4 not enough, 1/2 too much
; 3/8?
and #$7
cmp #5
bcc jump_no_move
jmp jump_change_x
; only change X every 8th frame
jump_change_x_regular:
lda GAIT
and #$7
bne jump_no_move
jump_change_x:
lda DIRECTION
beq jump_left

View File

@ -209,11 +209,12 @@ DUDE_X = $E9 ; C2 jail
STATE_NO_KEYPRESS = $80
STATE_CROUCHING = $40
STATE_RUNNING = $20
PHYSICIST_STATE = $EA
P_STANDING = $00
P_WALKING = $01
P_RUNNING = $02
P_RUNNING = $02 | STATE_RUNNING
P_CROUCHING = $03 | STATE_CROUCHING
P_KICKING = $04
P_JUMPING = $05 | STATE_NO_KEYPRESS