ootw: l3: steam collisions happen now

This commit is contained in:
Vince Weaver
2019-08-11 19:12:57 -04:00
parent 4d2b4e0548
commit 30d20a92fa
2 changed files with 100 additions and 2 deletions

View File

@@ -420,6 +420,24 @@ draw_fell_stop:
; dead/poisoned ; dead/poisoned
draw_poisoned: draw_poisoned:
lda PHYSICIST_X
sta XPOS
lda PHYSICIST_Y
and #$fe
sta YPOS
lda GAIT
lsr
lsr
and #$fe
tay
lda rolling_poison_progression,Y
sta INL
lda rolling_poison_progression+1,Y
jmp actually_draw
; rolling ; rolling
draw_rolling: draw_rolling:
@@ -455,13 +473,18 @@ actually_draw:
inc FRAMEH inc FRAMEH
vent_frame_no_oflo: vent_frame_no_oflo:
lda VENT_DEATH lda VENT_DEATH
beq no_death_count beq no_death_count
inc VENT_END_COUNT inc VENT_END_COUNT
no_death_count: no_death_count:
;==========================
; check if steamed
;==========================
jsr steam_collide
;========================== ;==========================
; check if done this level ; check if done this level
;========================== ;==========================
@@ -626,6 +649,14 @@ steam2_off: .byte 36
steam3_off: .byte 36 steam3_off: .byte 36
steam4_off: .byte 36 steam4_off: .byte 36
steam_on:
steam1_on: .byte 0
steam2_on: .byte 0
steam3_on: .byte 0
steam4_on: .byte 0
;============================== ;==============================
; handle steam ; handle steam
@@ -696,6 +727,9 @@ draw_steam_on:
and #$6 and #$6
tay tay
lda #1
sta steam_on,X
lda puff_cycle_progression,Y lda puff_cycle_progression,Y
sta INL sta INL
lda puff_cycle_progression+1,Y lda puff_cycle_progression+1,Y
@@ -708,14 +742,18 @@ draw_steam_stop:
lda puff_end_progression,Y lda puff_end_progression,Y
sta INL sta INL
lda puff_end_progression+1,Y lda puff_end_progression+1,Y
; jmp steam_draw
; fallthrough
steam_draw: steam_draw:
sta INH sta INH
jsr put_sprite jsr put_sprite
jmp steam_done
draw_steam_off: draw_steam_off:
lda #0
sta steam_on,X
steam_done: steam_done:
pla pla
tax tax
@@ -723,3 +761,59 @@ steam_done:
bpl steam_draw_loop bpl steam_draw_loop
rts rts
;==============================
; steam_collide
;==============================
steam_collide:
ldx #3
steam_collide_loop:
lda steam_on,X ; skip if no steam out
beq steam_loop_continue
lda PHYSICIST_Y
cmp steam_y,X
bne steam_loop_continue
; collide if
; =
; 0UUU physicist+3=X
; 0UUU physicist+2=X
; 0UUU physicist+1=X
clc
lda PHYSICIST_X
adc #1
cmp steam_x,X
beq steamed
adc #1
cmp steam_x,X
beq steamed
adc #1
cmp steam_x,X
beq steamed
steam_loop_continue:
dex
bpl steam_collide_loop
not_steamed:
rts
steamed:
lda #2
sta VENT_DEATH
rts

View File

@@ -50,6 +50,10 @@ rolling8:
.byte $AA,$AA,$99,$99,$B4 .byte $AA,$AA,$99,$99,$B4
.byte $AA,$AA,$99,$99,$BB .byte $AA,$AA,$99,$99,$BB
rolling_poison_progression:
.word poisoned1
.word poisoned2
.word poisoned3
poisoned1: poisoned1:
.byte 8,2 .byte 8,2