sb: add projectile

This commit is contained in:
Vince Weaver 2023-06-05 01:48:45 -04:00
parent 75bfb9b9a5
commit e86d1f503a
5 changed files with 39 additions and 0 deletions

View File

@ -105,6 +105,11 @@ load_background:
sta SHIELD_POSITION
sta SHIELD_COUNT
lda #20
sta BULLET_X
lda #90
sta BULLET_Y
;==========================
; main loop
;===========================
@ -197,6 +202,36 @@ no_move_head:
sta SPRITE_Y
jsr hgr_draw_sprite_big
;==========================
; move bullet
;===========================
inc BULLET_Y
lda BULLET_Y
cmp #150
bcc bullet_still_good
; new bullet position
; FIXME: better
lda #90
sta BULLET_Y
bullet_still_good:
;==========================
; draw bullet
;===========================
lda #<bullet0_sprite
sta INL
lda #>bullet0_sprite
sta INH
lda BULLET_X
sta SPRITE_X
lda BULLET_Y
sta SPRITE_Y
jsr hgr_draw_sprite_big
;==========================
; draw player
;===========================

View File

@ -37,6 +37,8 @@ sb_sprites.inc: sb_sprites.png
$(HGR_SPRITE) -s -l shield_left_sprite sb_sprites.png 0 138 83 192 >> sb_sprites.inc
$(HGR_SPRITE) -s -l shield_center_sprite sb_sprites.png 196 83 279 137 >> sb_sprites.inc
$(HGR_SPRITE) -s -l shield_right_sprite sb_sprites.png 196 138 279 192 >> sb_sprites.inc
$(HGR_SPRITE) -s -l bullet0_sprite sb_sprites.png 210 9 223 14 >> sb_sprites.inc

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -71,6 +71,8 @@ SHIELD_POSITION = $6E
SHIELD_UP_CENTER = 2
SHIELD_UP_RIGHT = 3
SHIELD_COUNT = $6F
BULLET_X = $70
BULLET_Y = $71
.if 0
REGISTER_DUMP = $70