mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-12-28 09:30:41 +00:00
lemm: handle falling into the water
This commit is contained in:
parent
d3d0e45941
commit
354ed0e013
@ -169,6 +169,7 @@ lemm.inc: generate_common LEMM
|
||||
./generate_common -a 0x6000 -s erase_pointer lemm.lst >> lemm.inc
|
||||
./generate_common -a 0x6000 -s update_remaining lemm.lst >> lemm.inc
|
||||
./generate_common -a 0x6000 -s update_remaining_all lemm.lst >> lemm.inc
|
||||
./generate_common -a 0x6000 -s collision_check_hazzard lemm.lst >> lemm.inc
|
||||
|
||||
####
|
||||
|
||||
|
@ -251,6 +251,12 @@ l4_door_is_open:
|
||||
|
||||
jsr move_lemmings
|
||||
|
||||
;=========================
|
||||
; extra check if in water
|
||||
|
||||
jsr collision_check_hazzard
|
||||
|
||||
|
||||
jsr draw_lemming
|
||||
|
||||
jsr handle_keypress
|
||||
|
@ -993,3 +993,45 @@ exit_y2_smc:
|
||||
not_done_level:
|
||||
rts
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;=============================
|
||||
; check if hit hazzard
|
||||
;=============================
|
||||
; TODO: make configurable
|
||||
collision_check_hazzard:
|
||||
ldy #0
|
||||
sty CURRENT_LEMMING
|
||||
|
||||
check_hazzard_loop:
|
||||
ldy CURRENT_LEMMING
|
||||
lda lemming_y,Y
|
||||
cmp #130
|
||||
bcs in_hazzard
|
||||
|
||||
bcc continue_check_hazzard
|
||||
|
||||
in_hazzard:
|
||||
|
||||
lda lemming_status,Y
|
||||
cmp #LEMMING_SPLATTING
|
||||
beq continue_check_hazzard ; don't re-splat
|
||||
|
||||
lda #LEMMING_SPLATTING
|
||||
sta lemming_status,Y
|
||||
|
||||
lda #0
|
||||
sta lemming_frame,Y
|
||||
|
||||
continue_check_hazzard:
|
||||
|
||||
inc CURRENT_LEMMING
|
||||
lda CURRENT_LEMMING
|
||||
cmp #MAX_LEMMINGS
|
||||
bne check_hazzard_loop
|
||||
|
||||
rts
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user