fish: add bubbles

This commit is contained in:
Vince Weaver 2024-06-12 15:41:46 -04:00
parent 39f04816d7
commit b5bdbe03f6
5 changed files with 99 additions and 224 deletions

View File

@ -226,6 +226,7 @@ load_background:
sta RED_FISH_STATE_PTR sta RED_FISH_STATE_PTR
sta GREY_FISH_STATE_PTR sta GREY_FISH_STATE_PTR
sta GREEN_FISH_STATE_PTR sta GREEN_FISH_STATE_PTR
sta BUBBLE_STATE_PTR ; init bubble too
; start at least 8k in? ; start at least 8k in?
@ -457,10 +458,60 @@ draw_green_fish:
done_draw_fish: done_draw_fish:
;============================ ;============================
; draw bubbles ; draw bubble
;============================
; yes there should be multiple bubbles possible at same time
; but I got lazy
draw_bubble:
ldx BUBBLE_STATE_PTR
bmi done_draw_bubble
cpx #6
bcc bubble_not_done
; disable bubble and don't draw
ldx #$FF
stx BUBBLE_STATE_PTR
bmi done_draw_bubble
bubble_not_done:
; set up co-ords
lda BUBBLE_X
sta SPRITE_X
lda BUBBLE_Y
sta SPRITE_Y
; set up sprite
lda bubble_sprite_table_l,X
sta INL
lda bubble_sprite_table_h,X
sta INH
; set up mask
lda bubble_mask_table_l,X
sta MASKL
lda bubble_mask_table_h,X
sta MASKH
jsr hgr_draw_sprite_mask
inc BUBBLE_STATE_PTR ; point to next state
dec BUBBLE_Y ; have bubble float up a bit
; dec BUBBLE_Y
done_draw_bubble:
;========================== ;==========================
; draw score ; draw score
;==========================
jsr draw_score jsr draw_score
@ -737,8 +788,16 @@ move_fish_flip:
sta RED_FISH_SPRITE,X sta RED_FISH_SPRITE,X
jmp done_update_fish jmp done_update_fish
move_fish_fast_right:
move_fish_bubble: move_fish_bubble:
lda #0
sta BUBBLE_STATE_PTR
lda RED_FISH_X,X
sta BUBBLE_X
lda RED_FISH_Y,X
sta BUBBLE_Y
jmp done_update_fish
move_fish_fast_right:
move_fish_pause: move_fish_pause:
jmp done_update_fish jmp done_update_fish
@ -933,3 +992,24 @@ green_fish_behavior:
; bubbles ; bubbles
; go medium/large/medium ; go medium/large/medium
; some go mostly up, some wiggle left right ; some go mostly up, some wiggle left right
bubble_sprite_table_l:
.byte <med1_bubble_sprite,<med1_bubble_sprite
.byte <big_bubble_sprite,<big_bubble_sprite
.byte <med2_bubble_sprite,<med2_bubble_sprite
bubble_sprite_table_h:
.byte >med1_bubble_sprite,>med1_bubble_sprite
.byte >big_bubble_sprite,>big_bubble_sprite
.byte >med2_bubble_sprite,>med2_bubble_sprite
bubble_mask_table_l:
.byte <med1_bubble_mask,<med1_bubble_mask
.byte <big_bubble_mask,<big_bubble_mask
.byte <med2_bubble_mask,<med2_bubble_mask
bubble_mask_table_h:
.byte >med1_bubble_mask,>med1_bubble_mask
.byte >big_bubble_mask,>big_bubble_mask
.byte >med2_bubble_mask,>med2_bubble_mask

View File

@ -76,6 +76,15 @@ fish_sprites.inc: fish_sprites.png
$(HGR_SPRITE) -s -l seven_sprite fish_sprites.png 28 80 34 87 >> fish_sprites.inc $(HGR_SPRITE) -s -l seven_sprite fish_sprites.png 28 80 34 87 >> fish_sprites.inc
$(HGR_SPRITE) -s -l eight_sprite fish_sprites.png 42 80 48 87 >> fish_sprites.inc $(HGR_SPRITE) -s -l eight_sprite fish_sprites.png 42 80 48 87 >> fish_sprites.inc
$(HGR_SPRITE) -s -l nine_sprite fish_sprites.png 56 80 62 87 >> fish_sprites.inc $(HGR_SPRITE) -s -l nine_sprite fish_sprites.png 56 80 62 87 >> fish_sprites.inc
$(HGR_SPRITE) -s -l med1_bubble_sprite fish_sprites.png 0 93 6 95 >> fish_sprites.inc
$(HGR_SPRITE) -s -l big_bubble_sprite fish_sprites.png 0 89 6 92 >> fish_sprites.inc
$(HGR_SPRITE) -s -l med2_bubble_sprite fish_sprites.png 0 96 6 98 >> fish_sprites.inc
$(HGR_SPRITE) -s -l med1_bubble_mask fish_sprites.png 0 105 6 107 >> fish_sprites.inc
$(HGR_SPRITE) -s -l big_bubble_mask fish_sprites.png 0 101 6 104 >> fish_sprites.inc
$(HGR_SPRITE) -s -l med2_bubble_mask fish_sprites.png 0 108 6 110 >> fish_sprites.inc

View File

@ -1,220 +0,0 @@
; 0 0 20 7
grey_fish_sprite:
.byte $03,$07
.byte $D5,$2A,$D5
.byte $51,$2A,$55
.byte $51,$2A,$55
.byte $55,$2F,$55
.byte $5F,$2B,$55
.byte $55,$2A,$55
.byte $55,$2A,$55
; 0 9 20 16
green_fish_sprite:
.byte $03,$07
.byte $D5,$54,$5A
.byte $1A,$55,$62
.byte $2A,$55,$62
.byte $29,$7D,$6A
.byte $29,$75,$7E
.byte $2A,$55,$6A
.byte $5A,$54,$5A
; 0 18 27 25
red_fish_sprite:
.byte $04,$07
.byte $D6,$D4,$AA,$AD
.byte $9A,$D5,$AA,$B1
.byte $AA,$D5,$AE,$B1
.byte $A9,$D5,$AF,$D5
.byte $A9,$D5,$AE,$F5
.byte $9A,$D5,$AA,$D5
.byte $D6,$D4,$AA,$AD
; 42 0 62 7
grey_fish_mask:
.byte $03,$07
.byte $70,$7F,$00
.byte $7C,$7F,$33
.byte $7F,$7F,$3F
.byte $7F,$7F,$0F
.byte $7F,$7F,$0F
.byte $7F,$7F,$3F
.byte $7C,$7F,$33
; 42 9 62 16
green_fish_mask:
.byte $03,$07
.byte $00,$7E,$0F
.byte $4F,$7F,$3F
.byte $7F,$7F,$3F
.byte $7C,$7F,$3F
.byte $7C,$7F,$3F
.byte $7F,$7F,$3F
.byte $0F,$7E,$0F
; 42 18 69 25
red_fish_mask:
.byte $04,$07
.byte $03,$7E,$7F,$07
.byte $4F,$7F,$7F,$1F
.byte $7F,$7F,$7F,$1F
.byte $7C,$7F,$7F,$7F
.byte $7C,$7F,$7F,$7F
.byte $4F,$7F,$7F,$7F
.byte $03,$7E,$7F,$07
; 0 29 20 36
left_fish_sprite:
.byte $03,$07
.byte $CA,$88,$AA
.byte $92,$A2,$88
.byte $C4,$88,$91
.byte $91,$A2,$A4
.byte $C4,$88,$A1
.byte $91,$A2,$84
.byte $C6,$88,$99
; 0 38 20 45
right_fish_sprite:
.byte $03,$07
.byte $AA,$89,$A1
.byte $A1,$A2,$84
.byte $C4,$88,$91
.byte $92,$A2,$84
.byte $C6,$88,$91
.byte $91,$A2,$84
.byte $A4,$89,$A1
; 0 47 27 54
big_fish_sprite:
.byte $04,$07
.byte $A9,$A3,$C4,$D0
.byte $E4,$88,$91,$C2
.byte $91,$A2,$C4,$C8
.byte $C6,$88,$91,$A2
.byte $92,$A2,$C4,$88
.byte $E4,$88,$91,$A2
.byte $A9,$A3,$C4,$D0
; 42 29 62 36
left_fish_mask:
.byte $03,$07
.byte $30,$66,$00
.byte $4C,$19,$33
.byte $33,$66,$0C
.byte $4C,$19,$03
.byte $33,$66,$0C
.byte $4C,$19,$33
.byte $30,$66,$00
; 42 38 62 45
right_fish_mask:
.byte $03,$07
.byte $00,$66,$0C
.byte $4C,$19,$33
.byte $33,$66,$0C
.byte $4C,$19,$33
.byte $30,$66,$0C
.byte $4C,$19,$33
.byte $03,$66,$0C
; 42 47 69 54
big_fish_mask:
.byte $04,$07
.byte $00,$18,$33,$06
.byte $03,$66,$4C,$19
.byte $4C,$19,$33,$06
.byte $30,$66,$4C,$19
.byte $4C,$19,$33,$66
.byte $03,$66,$4C,$19
.byte $00,$18,$33,$06
; 0 72 6 79
zero_sprite:
.byte $01,$07
.byte $1C
.byte $36
.byte $36
.byte $36
.byte $36
.byte $36
.byte $1C
; 14 72 20 79
one_sprite:
.byte $01,$07
.byte $18
.byte $1C
.byte $18
.byte $18
.byte $18
.byte $18
.byte $18
; 28 72 34 79
two_sprite:
.byte $01,$07
.byte $1E
.byte $30
.byte $30
.byte $1C
.byte $06
.byte $06
.byte $3E
; 42 72 48 79
three_sprite:
.byte $01,$07
.byte $1E
.byte $30
.byte $30
.byte $1C
.byte $30
.byte $30
.byte $1E
; 56 72 62 79
four_sprite:
.byte $01,$07
.byte $30
.byte $38
.byte $3C
.byte $3E
.byte $30
.byte $30
.byte $30
; 0 80 6 87
five_sprite:
.byte $01,$07
.byte $3E
.byte $06
.byte $1E
.byte $30
.byte $30
.byte $30
.byte $1E
; 14 80 20 87
six_sprite:
.byte $01,$07
.byte $3C
.byte $06
.byte $1E
.byte $36
.byte $36
.byte $36
.byte $1C
; 28 80 34 87
seven_sprite:
.byte $01,$07
.byte $3E
.byte $30
.byte $18
.byte $18
.byte $0C
.byte $0C
.byte $0C
; 42 80 48 87
eight_sprite:
.byte $01,$07
.byte $1C
.byte $36
.byte $36
.byte $1C
.byte $36
.byte $36
.byte $1C
; 56 80 62 87
nine_sprite:
.byte $01,$07
.byte $3C
.byte $36
.byte $36
.byte $36
.byte $3C
.byte $30
.byte $1E

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@ -129,14 +129,20 @@ COPY_TIME = $98
DECOMPRESS_TIME = $99 DECOMPRESS_TIME = $99
TIME_TAKEN = $9A TIME_TAKEN = $9A
LYRICS_ACTIVE = $9B LYRICS_ACTIVE = $9B
;FORTYCOL = $9C FORTYCOL = $9C
CURSOR = $9D CURSOR = $9D
CURRENT_DISK = $DC
; More zero-page addresses ; More zero-page addresses
; we try not to conflict with anything DOS, MONITOR or BASIC related ; we try not to conflict with anything DOS, MONITOR or BASIC related
BUBBLE_STATE_PTR = $D0
BUBBLE_X = $D1
BUBBLE_Y = $D2
CURRENT_DISK = $DC
SCORE_L = $E0 SCORE_L = $E0
SCORE_H = $E1 SCORE_H = $E1