lemm: explosion countdown

This commit is contained in:
Vince Weaver 2022-03-15 21:00:30 -04:00
parent 36ccd81c7e
commit 5a9824575c
7 changed files with 88 additions and 17 deletions

View File

@ -3,11 +3,6 @@
+ particle effects
+ wait a second after last lemming gone to exit
+ update the "in" %
+ proper check for successful vs not end of level
+ dig off the map, end level
+ level 5
-- door animation
-- music
+ let's go sound
+ fill in some of the ground so we don't get stuck when digging
+ update level5 end message to be personalized
+ Update credits?

View File

@ -11,10 +11,10 @@ erase_lemming:
lda lemming_y,Y
sec
sbc #3
sbc #6
sta SAVED_Y1
clc
adc #12
adc #15
sta SAVED_Y2
lda lemming_x,Y
@ -34,16 +34,41 @@ draw_lemming:
ldy #0
lda lemming_out,Y
bne do_draw_lemming
bne do_draw_countdown
jmp done_draw_lemming
do_draw_countdown:
lda lemming_exploding,Y
beq do_draw_lemming
ldx lemming_exploding
dex
lda countdown_sprites_l,X
sta INL
lda countdown_sprites_h,X
sta INH
ldx lemming_x,Y
stx XPOS
lda lemming_y,Y
sec
sbc #6
sta YPOS
jsr hgr_draw_sprite_autoshift
do_draw_lemming:
ldy #0
lda lemming_status,Y
cmp #LEMMING_DIGGING
beq draw_digging_sprite
cmp #LEMMING_FALLING
beq draw_falling_sprite
cmp #LEMMING_EXPLODING
beq draw_exploding_sprite
draw_walking_sprite:
@ -106,6 +131,27 @@ draw_falling_common:
jmp draw_common
;====================
; draw exploding
;====================
draw_exploding_sprite:
lda lemming_frame,Y
and #$f
tax
lda exploding_sprite_l,X
sta INL
lda exploding_sprite_h,X
sta INH
ldx lemming_x,Y
stx XPOS
lda lemming_y,Y
jmp draw_common
;======================
; digging
@ -186,7 +232,7 @@ lwalk_sprite_h:
.byte >lemming_lwalk5_sprite,>lemming_lwalk6_sprite
.byte >lemming_lwalk7_sprite,>lemming_lwalk8_sprite
explosion_sprite_l:
exploding_sprite_l:
.byte <lemming_explode1_sprite,<lemming_explode1_sprite
.byte <lemming_explode2_sprite,<lemming_explode3_sprite
.byte <lemming_explode4_sprite,<lemming_explode5_sprite
@ -196,7 +242,7 @@ explosion_sprite_l:
.byte <lemming_explode9_sprite,<lemming_explode8_sprite
.byte <lemming_explode9_sprite,<lemming_explode8_sprite
explosion_sprite_h:
exploding_sprite_h:
.byte >lemming_explode1_sprite,>lemming_explode1_sprite
.byte >lemming_explode2_sprite,>lemming_explode3_sprite
.byte >lemming_explode4_sprite,>lemming_explode5_sprite
@ -210,8 +256,11 @@ explosion_sprite_h:
; 787989898
; clcrlrlrle
countdown_sprites_l:
.byte <countdown5_sprite,<countdown4_sprite,<countdown3_sprite
.byte <countdown2_sprite,<countdown1_sprite
countdown_sprites_h:
.byte >countdown5_sprite,>countdown4_sprite,>countdown3_sprite
.byte >countdown2_sprite,>countdown1_sprite

View File

@ -280,7 +280,8 @@ plus_minus_buttons:
jmp done_menu
nuke_button:
; TODO
lda #1
sta lemming_exploding
jmp done_menu
map_grid_button:

View File

@ -95,6 +95,7 @@ do_level1:
lda #0
sta lemming_out
sta lemming_exploding
lda #12
sta lemming_x
lda #45

View File

@ -93,9 +93,10 @@ do_level5:
lda #0
sta lemming_out
sta lemming_exploding
lda #12
sta lemming_x
lda #45
lda #40
sta lemming_y
lda #1
sta lemming_direction

View File

@ -194,13 +194,16 @@ lemming_frame:
LEMMING_FALLING = 1
LEMMING_WALKING = 2
LEMMING_DIGGING = 3
LEMMING_EXPLODING = 4
lemming_status:
.byte LEMMING_FALLING
lemming_job:
lemming_exploding:
.byte $00
;=============================
; collision check ground
;=============================

View File

@ -1,6 +1,27 @@
; updates the time left
update_time:
; update explosion timer
; not ideal (first second might be short)
lda lemming_exploding
beq not_done_exploding
inc lemming_exploding
lda lemming_exploding
cmp #6
bne not_done_exploding
lda #LEMMING_EXPLODING
sta lemming_status
lda #0
sta lemming_frame
sta lemming_exploding
not_done_exploding:
sed
sec