lemm: add splatting

This commit is contained in:
Vince Weaver 2022-03-24 00:21:50 -04:00
parent 1ad56f6eba
commit c5fc707186
2 changed files with 72 additions and 2 deletions

View File

@ -86,6 +86,8 @@ do_draw_lemming:
beq draw_exploding_sprite beq draw_exploding_sprite
cmp #LEMMING_PARTICLES cmp #LEMMING_PARTICLES
beq draw_particles beq draw_particles
cmp #LEMMING_SPLATTING
beq draw_splatting_sprite
draw_walking_sprite: draw_walking_sprite:
@ -159,6 +161,18 @@ draw_exploding_sprite:
jmp done_draw_lemming jmp done_draw_lemming
;====================
; draw splatting
;====================
draw_splatting_sprite:
jsr handle_splatting
jmp done_draw_lemming
;==================== ;====================
; draw particles ; draw particles
;==================== ;====================
@ -292,6 +306,19 @@ countdown_sprites_h:
.byte >countdown2_sprite,>countdown1_sprite .byte >countdown2_sprite,>countdown1_sprite
splatting_sprite_l:
.byte <lemming_splat1_sprite,<lemming_splat2_sprite
.byte <lemming_splat3_sprite,<lemming_splat4_sprite
.byte <lemming_splat5_sprite,<lemming_splat6_sprite
.byte <lemming_splat7_sprite,<lemming_splat8_sprite
splatting_sprite_h:
.byte >lemming_splat1_sprite,>lemming_splat2_sprite
.byte >lemming_splat3_sprite,>lemming_splat4_sprite
.byte >lemming_splat5_sprite,>lemming_splat6_sprite
.byte >lemming_splat7_sprite,>lemming_splat8_sprite
;========================== ;==========================
; Handle particles ; Handle particles
;========================== ;==========================
@ -451,3 +478,40 @@ done_handle_exploding:
jsr hgr_draw_sprite_autoshift jsr hgr_draw_sprite_autoshift
rts rts
;==========================
; Handle splatting
;==========================
; moved to make room
handle_splatting:
lda lemming_frame,Y
cmp #$8
beq done_splatting
draw_splatting:
jsr click_speaker
tax
lda splatting_sprite_l,X
sta INL
lda splatting_sprite_h,X
sta INH
ldx lemming_x,Y
stx XPOS
lda lemming_y,Y
sta YPOS
jsr hgr_draw_sprite_autoshift
rts
done_splatting:
clc
jsr remove_lemming ; FIXME: tail call
rts

View File

@ -303,8 +303,14 @@ done_check_ground:
lemming_goes_splat: lemming_goes_splat:
clc lda #LEMMING_SPLATTING
jsr remove_lemming sta lemming_status,Y
lda #0
sta lemming_frame,Y
; clc
; jsr remove_lemming
rts rts