ootw: can run now

This commit is contained in:
Vince Weaver
2019-03-15 13:00:47 -04:00
parent 2ff3a299f9
commit 267e27289b
5 changed files with 123 additions and 26 deletions

View File

@@ -1,14 +1,13 @@
KNOWN BUGS:
+ ootw: pool monster grabs you a edge of pool (glitch)
+ intro: there's still a bit of a pause when the elevator door finishes opening
TODO: TODO:
BUGS:
+ beast grab you a edge of pool (glitch)
intro:
+ there's still a bit of a pause when the elevator door finishes opening
movement -- note these are hard due to limitations of the Apple II keyboard movement -- note these are hard due to limitations of the Apple II keyboard
+ ability to run + running: Missing one running frame
Missing one running frame
+ ability to jump + ability to jump
+ ability to kick while crouching + ability to kick while crouching
+ ability to shoot + ability to shoot

View File

@@ -15,23 +15,28 @@ keypress:
and #$7f ; clear high bit and #$7f ; clear high bit
check_quit: check_quit:
; cmp #'Q' cmp #27 ; quit if ESCAPE pressed
; beq quit bne check_walk_left
cmp #27
bne check_left ;=====================
; QUIT
;=====================
quit: quit:
lda #$ff ; could just dec lda #$ff ; could just dec
sta GAME_OVER sta GAME_OVER
rts rts
check_left: check_walk_left:
cmp #'A' cmp #'A'
beq left beq walk_left
cmp #$8 ; left arrow cmp #$8 ; left arrow
bne check_right bne check_walk_right
left:
; walk left
;====================
; Walk left
;====================
walk_left:
lda #P_WALKING lda #P_WALKING
sta PHYSICIST_STATE ; stand from crouching sta PHYSICIST_STATE ; stand from crouching
@@ -59,8 +64,6 @@ too_far_left:
just_fine_left: just_fine_left:
jmp done_keypress ; done jmp done_keypress ; done
face_left: face_left:
@@ -69,12 +72,17 @@ face_left:
sta GAIT sta GAIT
jmp done_keypress jmp done_keypress
check_right: check_walk_right:
cmp #'D' cmp #'D'
beq right beq walk_right
cmp #$15 cmp #$15
bne check_down bne check_run_left
right:
;===================
; Walk Right
;===================
walk_right:
lda #P_WALKING lda #P_WALKING
sta PHYSICIST_STATE sta PHYSICIST_STATE
@@ -113,11 +121,79 @@ face_right:
sta DIRECTION sta DIRECTION
jmp done_keypress jmp done_keypress
check_run_left:
cmp #'Q'
bne check_run_right
;====================
; Run left
;====================
run_left:
lda #P_RUNNING
sta PHYSICIST_STATE ; stand from crouching
lda DIRECTION ; if facing right, turn to face left
bne face_left
inc GAIT ; cycle through animation
inc GAIT ; cycle through animation
dec PHYSICIST_X ; walk left
jmp no_move_left
check_run_right:
cmp #'E'
bne check_up
;===================
; Run Right
;===================
run_right:
lda #P_RUNNING
sta PHYSICIST_STATE
lda DIRECTION
beq face_right
inc GAIT
inc GAIT
inc PHYSICIST_X
jmp no_move_right
check_up:
cmp #'W'
beq up
cmp #$0B
bne check_down
up:
;========================
; Jump
;========================
lda #P_JUMPING
sta PHYSICIST_STATE
lda #0
sta GAIT
jmp done_keypress
check_down: check_down:
cmp #'S' cmp #'S'
beq down beq down
cmp #$0A cmp #$0A
bne check_space bne check_space
;======================
; Crouch
;======================
down: down:
lda #P_CROUCHING lda #P_CROUCHING
sta PHYSICIST_STATE sta PHYSICIST_STATE
@@ -131,6 +207,10 @@ check_space:
beq space beq space
cmp #$15 cmp #$15
bne unknown bne unknown
;======================
; Kick
;======================
space: space:
lda #P_KICKING lda #P_KICKING
sta PHYSICIST_STATE sta PHYSICIST_STATE

View File

@@ -4,12 +4,14 @@ pstate_table_lo:
.byte <physicist_running .byte <physicist_running
.byte <physicist_crouching .byte <physicist_crouching
.byte <physicist_kicking .byte <physicist_kicking
.byte <physicist_jumping
pstate_table_hi: pstate_table_hi:
.byte >physicist_standing .byte >physicist_standing
.byte >physicist_standing .byte >physicist_standing
.byte >physicist_running .byte >physicist_running
.byte >physicist_crouching .byte >physicist_crouching
.byte >physicist_kicking .byte >physicist_kicking
.byte >physicist_jumping
pjump: pjump:
.word $0000 .word $0000
@@ -79,6 +81,23 @@ physicist_crouching:
jmp finally_draw_him jmp finally_draw_him
;===================================
; JUMPING
;===================================
physicist_jumping:
; FIXME: we have an animation?
lda #<crouch2
sta INL
lda #>crouch2
sta INH
jmp finally_draw_him
;=============================== ;===============================
; Walking ; Walking

View File

@@ -185,7 +185,7 @@ check_kicked:
lda PHYSICIST_STATE lda PHYSICIST_STATE
cmp #P_KICKING cmp #P_KICKING
beq check_attack bne check_attack
lda PHYSICIST_X lda PHYSICIST_X
sec sec

View File

@@ -133,8 +133,6 @@ CURSOR = $9D
; More zero-page addresses ; More zero-page addresses
; we try not to conflict with anything DOS, MONITOR or BASIC related ; we try not to conflict with anything DOS, MONITOR or BASIC related
JUMPING = $D0
LEFT_LIMIT = $E0 LEFT_LIMIT = $E0
RIGHT_LIMIT = $E1 RIGHT_LIMIT = $E1
WHICH_SLUG = $E2 WHICH_SLUG = $E2
@@ -161,6 +159,7 @@ PHYSICIST_STATE = $EA
P_RUNNING = $02 P_RUNNING = $02
P_CROUCHING = $03 P_CROUCHING = $03
P_KICKING = $04 P_KICKING = $04
P_JUMPING = $05
; CROUCHING = $EA ; CROUCHING = $EA
; KICKING = $EB ; KICKING = $EB