lemm: add bubble animation for level4

This commit is contained in:
Vince Weaver 2022-04-09 21:07:28 -04:00
parent 64041dcd32
commit d3d0e45941
5 changed files with 93 additions and 1 deletions

View File

@ -208,7 +208,7 @@ LEVEL4: level4.o
level4.o: level4.s zp.inc hardware.inc qload.inc lemm.inc \
release_lemming.s \
graphics/graphics_level4.inc
graphics/graphics_level4.inc graphics/l4_animation.inc
ca65 -o level4.o level4.s -l level4.lst

View File

@ -17,6 +17,7 @@ all: graphics_test.inc \
graphics_level9.inc \
graphics_level10.inc \
sprites.inc \
l4_animation.inc \
l6_animation.inc
@ -92,6 +93,18 @@ graphics_level10.inc: \
echo "level10_lzsa: .incbin \"level10.lzsa\"" > graphics_level10.inc
echo "level10_preview_lzsa: .incbin \"level10_preview.lzsa\"" >> graphics_level10.inc
###
l4_animation.inc: level_animations.png
$(HGR_SPRITE) -s -l bubble0_sprite level_animations.png 0 102 13 117> l4_animation.inc
$(HGR_SPRITE) -s -l bubble1_sprite level_animations.png 14 102 27 117>> l4_animation.inc
$(HGR_SPRITE) -s -l bubble2_sprite level_animations.png 28 102 41 117 >> l4_animation.inc
$(HGR_SPRITE) -s -l bubble3_sprite level_animations.png 42 102 55 117 >> l4_animation.inc
$(HGR_SPRITE) -s -l bubble4_sprite level_animations.png 56 102 69 117 >> l4_animation.inc
$(HGR_SPRITE) -s -l bubble5_sprite level_animations.png 70 102 83 117 >> l4_animation.inc
$(HGR_SPRITE) -s -l bubble6_sprite level_animations.png 84 102 97 117 >> l4_animation.inc
$(HGR_SPRITE) -s -l bubble7_sprite level_animations.png 98 102 111 117 >> l4_animation.inc
###

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 917 B

After

Width:  |  Height:  |  Size: 8.0 KiB

View File

@ -230,6 +230,16 @@ l4_door_is_open:
jsr draw_flames
;====================
; draw level animation
;====================
jsr draw_bubbles
;====================
; update timer
;====================
jsr update_timer
@ -305,3 +315,72 @@ level4_intro_text:
.byte 13,18,"TIME 5 MINUTES",0
.byte 15,20,"RATING FUN",0
.byte 8,23,"PRESS RETURN TO CONTINUE",0
;===============
; draw bubbles
;===============
draw_bubbles:
; bubble 1
lda FRAMEL
and #$7
tay
lda bubble_sprites_l,Y
sta INL
lda bubble_sprites_h,Y
sta INH
lda #4 ; 4, 14, 24, 34
sta XPOS
lda #137
sta YPOS
jsr hgr_draw_sprite
; bubble 2
lda FRAMEL
clc
adc #4
and #$7
tay
lda bubble_sprites_l,Y
sta INL
lda bubble_sprites_h,Y
sta INH
lda #24 ; 4, 14, 24, 34
sta XPOS
lda #137
sta YPOS
jmp hgr_draw_sprite ; tail call
; rts
.include "graphics/l4_animation.inc"
bubble_sprites_l:
.byte <bubble0_sprite,<bubble1_sprite
.byte <bubble2_sprite,<bubble3_sprite
.byte <bubble4_sprite,<bubble5_sprite
.byte <bubble6_sprite,<bubble7_sprite
bubble_sprites_h:
.byte >bubble0_sprite,>bubble1_sprite
.byte >bubble2_sprite,>bubble3_sprite
.byte >bubble4_sprite,>bubble5_sprite
.byte >bubble6_sprite,>bubble7_sprite