sb: asplode more or less there

This commit is contained in:
Vince Weaver 2023-06-09 15:43:52 -04:00
parent a6a2fb235c
commit c3dd6b2687
4 changed files with 331 additions and 107 deletions

View File

@ -65,7 +65,7 @@ asplode.o: asplode.s zx02_optim.s \
asplode_graphics/sb_zone.hgr.zx02 \
asplode_graphics/sb_sprites.inc \
asplode_sound/asplode.btc.zx02 \
audio.s play_asplode.s \
audio.s play_asplode.s asplode_head.s \
hgr_sprite_big.s cycle_colors.s \
zp.inc hardware.inc
ca65 -o asplode.o asplode.s -l asplode.lst

View File

@ -163,7 +163,7 @@ main_loop:
;========================
; copy over background
;========================
reset_loop:
jsr hgr_copy
@ -357,7 +357,7 @@ asplode_asplode:
jsr do_asplode
jmp main_loop
jmp reset_loop
;==========================
; done game
@ -378,103 +378,7 @@ wait_until_keypress:
rts
;==============================
; do the asplode routine
;==============================
; should move head to center
; player explosion happens
; do the "YOUR HEAD A SPLODE" animation
; try to interleave the sound
; in theory the background should pulse too but
; that might be too much
do_asplode:
;===================
; copy background
;===================
jsr hgr_copy
;==========================
; draw head
;==========================
lda #<big_head0_sprite
sta INL
lda #>big_head0_sprite
sta INH
lda #16 ; center
sta SPRITE_X
lda #36
sta SPRITE_Y
jsr hgr_draw_sprite_big
;==========================
; draw your
;==========================
lda #<your_sprite
sta INL
lda #>your_sprite
sta INH
lda #8
sta SPRITE_X
lda #133
sta SPRITE_Y
jsr hgr_draw_sprite_big
;==========================
; draw head
;==========================
lda #<head_sprite
sta INL
lda #>head_sprite
sta INH
lda #15
sta SPRITE_X
lda #133
sta SPRITE_Y
jsr hgr_draw_sprite_big
;==========================
; draw A
;==========================
lda #<a_sprite
sta INL
lda #>a_sprite
sta INH
lda #21
sta SPRITE_X
lda #133
sta SPRITE_Y
jsr hgr_draw_sprite_big
;==========================
; draw SPLODE
;==========================
lda #<splode_sprite
sta INL
lda #>splode_sprite
sta INH
lda #23
sta SPRITE_X
lda #133
sta SPRITE_Y
jsr hgr_draw_sprite_big
; play sound
; jsr play_asplode
jsr flip_page
jsr wait_until_keypress
rts
.include "asplode_head.s"
;==========
; flip page

View File

@ -64,13 +64,13 @@ sb_sprites.inc: sb_sprites.png
$(HGR_SPRITE) -s -l a_sprite sb_sprites.png 98 0 104 20 >> sb_sprites.inc
$(HGR_SPRITE) -s -l splode_sprite sb_sprites.png 112 0 166 20 >> sb_sprites.inc
$(HGR_SPRITE) -s -l your_med_sprite sb_sprites.png 0 22 33 31 >> sb_sprites.inc
$(HGR_SPRITE) -s -l head_med_sprite sb_sprites.png 42 22 69 31 >> sb_sprites.inc
$(HGR_SPRITE) -s -l a_med_sprite sb_sprites.png 84 22 89 31 >> sb_sprites.inc
$(HGR_SPRITE) -s -l splode_med_sprite sb_sprites.png 98 22 138 31 >> sb_sprites.inc
$(HGR_SPRITE) -s -l your_sm_sprite sb_sprites.png 0 32 19 37 >> sb_sprites.inc
$(HGR_SPRITE) -s -l head_sm_sprite sb_sprites.png 28 32 47 37 >> sb_sprites.inc
$(HGR_SPRITE) -s -l a_sm_sprite sb_sprites.png 0 38 5 43 >> sb_sprites.inc
$(HGR_SPRITE) -s -l splode_sm_sprite sb_sprites.png 14 38 33 43 >> sb_sprites.inc
$(HGR_SPRITE) -s -l head_med_sprite sb_sprites.png 0 32 26 41 >> sb_sprites.inc
$(HGR_SPRITE) -s -l a_med_sprite sb_sprites.png 42 32 47 41 >> sb_sprites.inc
$(HGR_SPRITE) -s -l splode_med_sprite sb_sprites.png 0 42 40 51 >> sb_sprites.inc
$(HGR_SPRITE) -s -l your_sm_sprite sb_sprites.png 0 52 19 57 >> sb_sprites.inc
$(HGR_SPRITE) -s -l head_sm_sprite sb_sprites.png 28 52 47 57 >> sb_sprites.inc
$(HGR_SPRITE) -s -l a_sm_sprite sb_sprites.png 0 58 5 63 >> sb_sprites.inc
$(HGR_SPRITE) -s -l splode_sm_sprite sb_sprites.png 14 58 33 63 >> sb_sprites.inc
$(HGR_SPRITE) -s -l bullet_done_sprite sb_sprites.png 168 114 180 123 >> sb_sprites.inc
$(HGR_SPRITE) -s -l asploding1_sprite sb_sprites.png 196 27 222 52 >> sb_sprites.inc
$(HGR_SPRITE) -s -l asploding2_sprite sb_sprites.png 238 27 264 52 >> sb_sprites.inc

320
games/sb/asplode_head.s Normal file
View File

@ -0,0 +1,320 @@
;==============================
; do the asplode routine
;==============================
; should move head to center
; player explosion happens
; do the "YOUR HEAD A SPLODE" animation
; try to interleave the sound
; in theory the background should pulse too but
; that might be too much
do_asplode:
lda #0
sta FRAME
lda #16
sta STRONGBAD_X
asplode_loop:
;===================
; copy background
;===================
jsr hgr_copy
;==========================
; draw head
;==========================
lda #<big_head0_sprite
sta INL
lda #>big_head0_sprite
sta INH
lda #16 ; center
sta SPRITE_X
lda #36
sta SPRITE_Y
jsr hgr_draw_sprite_big
;==========================
; draw new sprite
;==========================
ldx FRAME
lda asplode_sprite_l,X
sta INL
lda asplode_sprite_h,X
sta INH
lda asplode_sprite_x,X
sta SPRITE_X
lda asplode_sprite_y,X
sta SPRITE_Y
jsr hgr_draw_sprite_big
ldx FRAME
cpx #17
bcc done_extra_sprites
;==========================
; draw your
;==========================
lda #<your_sprite
sta INL
lda #>your_sprite
sta INH
lda #8
sta SPRITE_X
lda #133
sta SPRITE_Y
jsr hgr_draw_sprite_big
ldx FRAME
cpx #23
bcc done_extra_sprites
;==========================
; draw head
;==========================
lda #<head_sprite
sta INL
lda #>head_sprite
sta INH
lda #16
sta SPRITE_X
lda #133
sta SPRITE_Y
jsr hgr_draw_sprite_big
ldx FRAME
cpx #29
bcc done_extra_sprites
;==========================
; draw A
;==========================
lda #<a_sprite
sta INL
lda #>a_sprite
sta INH
lda #22
sta SPRITE_X
lda #133
sta SPRITE_Y
jsr hgr_draw_sprite_big
done_extra_sprites:
.if 0
;==========================
; draw SPLODE
;==========================
lda #<splode_sprite
sta INL
lda #>splode_sprite
sta INH
lda #23
sta SPRITE_X
lda #133
sta SPRITE_Y
jsr hgr_draw_sprite_big
.endif
; play sound
; jsr play_asplode
jsr flip_page
inc FRAME
lda FRAME
cmp #35
bcs done_asplode_head
jmp asplode_loop
done_asplode_head:
lda #20
jsr long_wait ; tail call
rts
asplode_sprite_l:
; begining explosion
.byte <asploding1_sprite ; 0
.byte <asploding1_sprite ; 1
.byte <asploding2_sprite ; 2
.byte <asploding3_sprite ; 3
.byte <asploding4_sprite ; 4
.byte <asploding2_sprite ; 5
.byte <asploding3_sprite ; 6
.byte <asploding4_sprite ; 7
.byte <asploding2_sprite ; 8
.byte <asploding3_sprite ; 9
.byte <asploding4_sprite ; 10
; your
.byte <your_sm_sprite ; 11
.byte <your_sm_sprite ; 12
.byte <your_med_sprite ; 13
.byte <your_med_sprite ; 14
.byte <your_sprite ; 15
.byte <your_sprite ; 16
; head
.byte <head_sm_sprite ; 17
.byte <head_sm_sprite ; 18
.byte <head_med_sprite ; 19
.byte <head_med_sprite ; 20
.byte <head_sprite ; 21
.byte <head_sprite ; 22
; a
.byte <a_sm_sprite ; 23
.byte <a_sm_sprite ; 24
.byte <a_med_sprite ; 25
.byte <a_med_sprite ; 26
.byte <a_sprite ; 27
.byte <a_sprite ; 28
; splode
.byte <splode_sm_sprite ; 29
.byte <splode_sm_sprite ; 30
.byte <splode_med_sprite ; 31
.byte <splode_med_sprite ; 32
.byte <splode_sprite ; 33
.byte <splode_sprite ; 34
asplode_sprite_h:
.byte >asploding1_sprite
.byte >asploding1_sprite
.byte >asploding2_sprite
.byte >asploding3_sprite
.byte >asploding4_sprite
.byte >asploding2_sprite
.byte >asploding3_sprite
.byte >asploding4_sprite
.byte >asploding2_sprite
.byte >asploding3_sprite
.byte >asploding4_sprite
; your
.byte >your_sm_sprite
.byte >your_sm_sprite
.byte >your_med_sprite
.byte >your_med_sprite
.byte >your_sprite
.byte >your_sprite
; head
.byte >head_sm_sprite
.byte >head_sm_sprite
.byte >head_med_sprite
.byte >head_med_sprite
.byte >head_sprite
.byte >head_sprite
; a
.byte >a_sm_sprite
.byte >a_sm_sprite
.byte >a_med_sprite
.byte >a_med_sprite
.byte >a_sprite
.byte >a_sprite
; splode
.byte >splode_sm_sprite
.byte >splode_sm_sprite
.byte >splode_med_sprite
.byte >splode_med_sprite
.byte >splode_sprite
.byte >splode_sprite
asplode_sprite_x:
.byte 19 ; FIXME: adjust for current pos
.byte 19
.byte 19
.byte 19
.byte 19
.byte 19
.byte 19
.byte 19
.byte 19
.byte 19
.byte 19
; your
.byte 18
.byte 17
.byte 14
.byte 12
.byte 9
.byte 8
; head
.byte 18
.byte 18
.byte 17
.byte 17
.byte 16
.byte 16
; a
.byte 19
.byte 20
.byte 20
.byte 21
.byte 22
.byte 22
; splode
.byte 18
.byte 20
.byte 20
.byte 21
.byte 22
.byte 24
asplode_sprite_y:
.byte 150
.byte 150
.byte 150
.byte 150
.byte 150
.byte 150
.byte 150
.byte 150
.byte 150
.byte 150
.byte 150
; your
.byte 80
.byte 90
.byte 100
.byte 111
.byte 122
.byte 133
; head
.byte 80
.byte 90
.byte 100
.byte 111
.byte 122
.byte 133
; a
.byte 80
.byte 90
.byte 100
.byte 111
.byte 122
.byte 133
; splode
.byte 80
.byte 90
.byte 100
.byte 111
.byte 122
.byte 133
long_wait:
ldx #10
long_wait_loop:
lda #255
jsr WAIT
dex
bne long_wait_loop
rts