ootw: vent: more or less have wall detection going

This commit is contained in:
Vince Weaver 2019-08-06 01:07:51 -04:00
parent cb522d4fb3
commit 5599d9b6dd
4 changed files with 210 additions and 33 deletions

View File

@ -7,6 +7,7 @@ ootw_vent:
lda #0
sta GAIT
sta FALLING
lda #17
sta PHYSICIST_X
@ -110,16 +111,189 @@ vent_adjust_gait:
vent_done_keyboard:
bit KEYRESET
;===============================
; move physicist
; jsr move_physicist
;=======================
; bounds_check and slope
;===============
; check room limits
; 42, can't go less than 10
; 42, cant go more than 38
; jsr check_screen_limit
ldx PHYSICIST_X
lda PHYSICIST_Y
cmp #42
bne not_life_universe_everything
vent_bounds_check_left:
cpx #(5-2)
bcs vent_bounds_check_right
lda #5
sta PHYSICIST_X
jmp done_vent_bounds
vent_bounds_check_right:
cpx #(38-2)
bcc done_vent_bounds
lda #35
sta PHYSICIST_X
jmp done_vent_bounds
not_life_universe_everything:
; 11 -> if (y==11) and (x>5) y=12
; 12 -> if (y==12) and (x>11) y=13
; if (y==12) and (x<6) y=11
; 13 -> if (y==13) and (x>15) y=14
; if (y==13) and (x<10) y=12
; 14 -> if (y==14) and (x<16) y=13
cmp #11
bne check_12
cpx #(2-2)
bpl check_11_right
lda #(2-2)
sta PHYSICIST_X
jmp done_vent_bounds
check_11_right:
cpx #(5-2)
bcs vent_inc_y ; bge
bcc done_vent_bounds
check_12:
cmp #12
bne check_13
cpx #(11-2)
bcs vent_inc_y ; bge
cpx #(5-2)
bcc vent_dec_y ; blt
bcs done_vent_bounds ; bra
check_13:
cmp #13
bne check_14
cpx #(15-2)
bcs vent_inc_y ; bge
cpx #(10-2)
bcc vent_dec_y ; blt
bcs done_vent_bounds ; bra
check_14:
cmp #14
bne done_vent_bounds
cpx #(14-2)
bcc vent_dec_y ; blt
bcs done_vent_bounds ; bra
vent_inc_y:
inc PHYSICIST_Y
jmp done_vent_bounds
vent_dec_y:
dec PHYSICIST_Y
done_vent_bounds:
;==================
; check if falling
lda FALLING
bne done_vent_checky ; don't check if allready falling
ldx PHYSICIST_X
lda PHYSICIST_Y
cmp #2
beq vent_y2
cmp #14
beq vent_y14
cmp #22
beq vent_y22
cmp #32
beq vent_y32
cmp #42
beq vent_y42
jmp done_vent_checky
; y=2 -> 2+3, 37+38
vent_y2:
ldy #11
cpx #(4-2)
bcc vent_falling ; blt
ldy #42
cpx #(37-2)
bcs vent_falling ; bge
jmp done_vent_checky
; y=14 -> 20+21
vent_y14:
ldy #22
cpx #(20-2)
beq vent_falling
cpx #(21-2)
beq vent_falling
jmp done_vent_checky
jmp done_vent_checky
; y=22 -> 5+6 , 30+31
vent_y22:
ldy #42
cpx #(7-2)
bcc vent_falling ; blt
ldy #32
cpx #(30-2)
bcs vent_falling ; bge
jmp done_vent_checky
; y=32 -> 16+17, 37+38
vent_y32:
ldy #42
cpx #(18-2)
bcc vent_falling ; blt
cpx #(37-2)
bcs vent_falling ; bge
jmp done_vent_checky
; y=42 -> 21+22
vent_y42:
ldy #50
cpx #(21-2)
beq vent_falling
cpx #(22-2)
beq vent_falling
bne done_vent_checky ; bra
vent_falling:
lda #1
sta FALLING
sty FALLING_Y
done_vent_checky:
;==================
; fall if falling
lda FALLING
beq done_falling
inc PHYSICIST_Y
lda PHYSICIST_Y
cmp FALLING_Y
bne done_falling
dec FALLING
done_falling:
;===============
; draw physicist
@ -127,6 +301,7 @@ vent_done_keyboard:
lda PHYSICIST_X
sta XPOS
lda PHYSICIST_Y
and #$fe ; FIXME
sta YPOS
lda GAIT

View File

@ -1,36 +1,36 @@
vent_rle: .byte $28 ; ysize=48
.byte $00, $AC,$20, $50, $A5,$20, $22, $00,$00, $22
.byte $A0,$11,$20, $00, $22, $AB,$00, $05, $A0,$19,$00, $22
.byte $00, $22, $00,$00, $A0,$21,$20, $00,$00, $22, $00
.byte $22, $00,$00, $22, $A0,$1F,$00, $22, $00,$00, $22
.byte $00, $22, $00,$00, $22, $A0,$1F,$00, $22, $00,$00
.byte $22, $00, $22, $00,$00, $A3,$02, $22, $A5,$20
.byte $A0,$17,$00, $22, $00,$00, $22, $00, $22, $AA,$00
.byte $55, $A4,$02, $22, $A5,$20, $A6,$00, $88,$88, $8F
.byte $FF, $A3,$00, $22, $00,$00, $22, $00, $A4,$02
.byte $22, $A5,$20, $AB,$00, $22, $A6,$00, $2B, $00
.byte $0B, $22, $A3,$00, $22, $00,$00, $22, $AA,$00
.byte $A5,$02, $22, $A4,$20, $00,$00, $22, $A6,$00, $22
.byte $00,$00, $22, $A3,$00, $22, $00,$00, $22, $A0,$13,$00
.byte $22, $00,$00, $22, $A6,$00, $22, $00,$00, $22
.byte $00, $AC,$20, $70, $A5,$20, $22, $00,$00, $22
.byte $A0,$11,$20, $00, $22, $A0,$25,$00, $22, $00, $22
.byte $00,$00, $A0,$21,$20, $00,$00, $22, $00, $22, $00,$00
.byte $22, $A0,$1F,$00, $22, $00,$00, $22, $00, $22
.byte $00,$00, $22, $A0,$1F,$00, $22, $00,$00, $22, $00
.byte $22, $00,$00, $A3,$02, $22, $A5,$20, $A0,$17,$00, $22
.byte $00,$00, $22, $00, $22, $AA,$00, $07, $A4,$02
.byte $22, $A5,$20, $A6,$00, $88,$88, $8F, $FF, $A3,$00
.byte $22, $00,$00, $22, $00, $A4,$02, $22, $A5,$20
.byte $AB,$00, $22, $A6,$00, $2B, $00, $0B, $22
.byte $A3,$00, $22, $00,$00, $22, $AA,$00, $A5,$02, $22
.byte $A4,$20, $00,$00, $22, $A6,$00, $22, $00,$00, $22
.byte $A3,$00, $22, $00,$00, $22, $A0,$13,$00, $22, $00,$00
.byte $22, $A6,$00, $22, $00,$00, $22, $A3,$00, $22
.byte $00,$00, $02, $A4,$00, $22, $AD,$02, $55, $02
.byte $00,$00, $02, $55, $A6,$02, $00,$00, $22, $A3,$00
.byte $22, $A7,$00, $22, $A0,$1B,$00, $22, $A3,$00, $22
.byte $A7,$00, $22, $00,$00, $A0,$17,$20, $00,$00, $22, $A3,$00
.byte $22, $00,$00, $22, $A4,$00, $22, $00,$00, $22
.byte $00,$00, $22, $A4,$00, $AE,$20, $70, $22, $00,$00
.byte $22, $70, $A5,$20, $22, $00,$00, $22, $A3,$00
.byte $22, $00,$00, $22, $A4,$00, $22, $A0,$1B,$00, $22
.byte $A3,$00, $22, $A7,$00, $22, $00,$00, $A0,$17,$20, $00,$00
.byte $22, $A3,$00, $22, $A7,$00, $22, $00,$00, $22
.byte $A0,$15,$00, $22, $00,$00, $22, $A3,$00, $22, $00,$00
.byte $22, $A4,$00, $22, $00,$00, $22, $A0,$15,$00, $22
.byte $00,$00, $22, $A3,$00, $22, $00,$00, $22, $A5,$02
.byte $00,$00, $22, $A7,$00, $22, $AE,$02, $00,$00, $A5,$02
.byte $00,$00, $22, $A7,$00, $22, $A7,$00, $22, $A0,$17,$00
.byte $22, $A4,$02, $22, $00,$00, $22, $A7,$00, $22
.byte $00,$00, $22, $A0,$11,$02, $22, $00,$00, $22, $A4,$00
.byte $00,$00, $22, $A3,$00, $22, $00,$00, $22, $A4,$20
.byte $22, $00,$00, $22, $A7,$00, $AE,$20, $22, $00,$00
.byte $22, $A3,$20, $22, $00,$00, $22, $A7,$00, $22
.byte $A7,$00, $22, $A0,$17,$00, $22, $A5,$20, $00,$00, $22
.byte $A7,$00, $22, $00,$00, $A0,$13,$20, $00,$00, $22, $A4,$00
.byte $22, $00,$00, $22, $A7,$00, $22, $00,$00, $22
.byte $A0,$11,$00, $22, $00,$00, $22, $A4,$00, $22, $00,$00
.byte $22, $A7,$00, $22, $00,$00, $22, $A0,$11,$00, $22
.byte $00,$00, $22, $A4,$00, $22, $00,$00, $A9,$02, $00,$00
.byte $A0,$13,$02, $00,$00, $22, $A4,$00, $22, $A0,$22,$00, $22
.byte $A4,$00, $A0,$10,$02, $22, $00,$00, $22, $A0,$10,$02
.byte $00,$00, $22, $A4,$00, $22, $00,$00, $22, $A7,$20
.byte $22, $00,$00, $22, $A0,$11,$20, $22, $00,$00, $22
.byte $A4,$00, $22, $A0,$22,$00, $22, $A4,$00, $22, $A0,$10,$20
.byte $00,$00, $A0,$10,$20, $22, $A0,$14,$00, $22, $00,$00, $22
.byte $A0,$10,$00
.byte $A1

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

@ -150,6 +150,7 @@ DNA_PROGRESS = $E6 ; INTRO
TIME_COUNT = $E6 ; INTRO
EQUAKE_PROGRESS = $E6 ; C1
DUDE_OUT = $E6 ; C2
FALLING = $E6 ; C3
EARTH_OFFSET = $E7 ; ALL??
DNA_COUNT = $E7 ; INTRO
@ -161,6 +162,7 @@ MONSTER_WHICH = $E8 ; C1 underwater
BOULDER_X = $E8 ; C1
LITTLEGUY_OUT = $E8 ; C2 cage
CART_X = $E8 ; C2 jail
FALLING_Y = $E8 ; C3
BOULDER_Y = $E9 ; C1
SHOOTING_TOP = $E9 ; C1 cage