mirror of
https://github.com/deater/dos33fsprogs.git
synced 2025-01-16 11:30:55 +00:00
sb: projectile animation
This commit is contained in:
parent
9ded41d8bd
commit
790437e339
@ -4,6 +4,18 @@
|
||||
;
|
||||
; by deater (Vince Weaver) <vince@deater.net>
|
||||
|
||||
; some notes on the engine from the original
|
||||
; bullet moving is not 3d in any way, it's just 2D
|
||||
; there are distinct Y locations with different sized sprites
|
||||
; X velocity starts at 3
|
||||
; hitting shield left, subs random 0..5
|
||||
; hitting shield right, adds random 0..5
|
||||
; hitting shield center, adds random -0.5 .. 0.5
|
||||
; bounces off side walls roughly at same X as back walls
|
||||
; doesn't even try to adjust for Y
|
||||
; if it hits back wall, it reflects back
|
||||
; if it misses you, makes small explosion, starts again at far wall
|
||||
; with same X as it went off screen with
|
||||
|
||||
.include "zp.inc"
|
||||
.include "hardware.inc"
|
||||
@ -132,9 +144,13 @@ load_background:
|
||||
sta SHIELD_POSITION
|
||||
sta SHIELD_COUNT
|
||||
|
||||
lda #0
|
||||
sta BULLET_X_L
|
||||
sta BULLET_X_VEL
|
||||
|
||||
lda #20
|
||||
sta BULLET_X
|
||||
lda #90
|
||||
lda #0
|
||||
sta BULLET_Y
|
||||
|
||||
;==========================
|
||||
@ -233,15 +249,27 @@ no_move_head:
|
||||
; move bullet
|
||||
;===========================
|
||||
|
||||
; 16 bit add
|
||||
|
||||
clc
|
||||
lda BULLET_X_L
|
||||
adc BULLET_X_VEL
|
||||
sta BULLET_X_L
|
||||
lda BULLET_X
|
||||
adc #0
|
||||
sta BULLET_X
|
||||
|
||||
; TODO: bounce off walls
|
||||
|
||||
inc BULLET_Y
|
||||
lda BULLET_Y
|
||||
cmp #150
|
||||
cmp #15
|
||||
bcc bullet_still_good
|
||||
|
||||
; new bullet position
|
||||
; FIXME: better
|
||||
|
||||
lda #90
|
||||
lda #0
|
||||
sta BULLET_Y
|
||||
bullet_still_good:
|
||||
|
||||
@ -249,13 +277,16 @@ bullet_still_good:
|
||||
; draw bullet
|
||||
;===========================
|
||||
|
||||
lda #<bullet0_sprite
|
||||
ldy BULLET_Y
|
||||
lda bullet_sprite_l,Y
|
||||
sta INL
|
||||
lda #>bullet0_sprite
|
||||
lda bullet_sprite_h,Y
|
||||
sta INH
|
||||
|
||||
lda BULLET_X
|
||||
sta SPRITE_X
|
||||
lda BULLET_Y
|
||||
|
||||
lda bullet_sprite_y,Y
|
||||
sta SPRITE_Y
|
||||
jsr hgr_draw_sprite_big
|
||||
|
||||
@ -389,3 +420,50 @@ shield_sprites_l:
|
||||
shield_sprites_h:
|
||||
.byte >player_sprite,>shield_left_sprite
|
||||
.byte >shield_center_sprite,>shield_right_sprite
|
||||
|
||||
|
||||
y_positions:
|
||||
; 90 to 160 roughly? Let's say 64?
|
||||
; have 16 positions? 4 each?
|
||||
|
||||
; can probably optimize this
|
||||
|
||||
bullet_sprite_l:
|
||||
.byte <bullet0_sprite, <bullet1_sprite, <bullet2_sprite, <bullet3_sprite
|
||||
.byte <bullet4_sprite, <bullet5_sprite, <bullet6_sprite, <bullet7_sprite
|
||||
.byte <bullet8_sprite, <bullet9_sprite,<bullet10_sprite,<bullet11_sprite
|
||||
.byte <bullet12_sprite,<bullet13_sprite,<bullet14_sprite,<bullet15_sprite
|
||||
|
||||
bullet_sprite_h:
|
||||
.byte >bullet0_sprite, >bullet1_sprite, >bullet2_sprite, >bullet3_sprite
|
||||
.byte >bullet4_sprite, >bullet5_sprite, >bullet6_sprite, >bullet7_sprite
|
||||
.byte >bullet8_sprite, >bullet9_sprite,>bullet10_sprite,>bullet11_sprite
|
||||
.byte >bullet12_sprite,>bullet13_sprite,>bullet14_sprite,>bullet15_sprite
|
||||
|
||||
bullet_sprite_y:
|
||||
.byte 90,94,98,102
|
||||
.byte 106,110,114,118
|
||||
.byte 122,126,130,134
|
||||
.byte 138,142,146,150
|
||||
|
||||
; original
|
||||
; 1 = 6
|
||||
; 2 = 12
|
||||
; 3 = 18
|
||||
; 4 = 25
|
||||
; 5 = 32
|
||||
; 6 = 38
|
||||
; 7 = 44
|
||||
; 8 = 50
|
||||
; 9 = 57
|
||||
; 10= 63
|
||||
; 11= 70
|
||||
; 12= 77
|
||||
; 13= 82
|
||||
; 14= 89
|
||||
; 15= 95
|
||||
; 27= 167 (peak)
|
||||
; 30= 148
|
||||
; 31= 139
|
||||
|
||||
; 9,5 -> 22,14 = 12x9 roughly. 3 times smaller, 4x3? 2x6?
|
||||
|
@ -37,7 +37,23 @@ 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
|
||||
$(HGR_SPRITE) -s -l bullet0_sprite sb_sprites.png 168 1 181 7 >> sb_sprites.inc
|
||||
$(HGR_SPRITE) -s -l bullet1_sprite sb_sprites.png 168 8 181 14 >> sb_sprites.inc
|
||||
$(HGR_SPRITE) -s -l bullet2_sprite sb_sprites.png 168 15 181 21 >> sb_sprites.inc
|
||||
$(HGR_SPRITE) -s -l bullet3_sprite sb_sprites.png 168 22 181 28 >> sb_sprites.inc
|
||||
$(HGR_SPRITE) -s -l bullet4_sprite sb_sprites.png 168 29 181 35 >> sb_sprites.inc
|
||||
$(HGR_SPRITE) -s -l bullet5_sprite sb_sprites.png 168 36 181 42 >> sb_sprites.inc
|
||||
$(HGR_SPRITE) -s -l bullet6_sprite sb_sprites.png 168 43 181 49 >> sb_sprites.inc
|
||||
$(HGR_SPRITE) -s -l bullet7_sprite sb_sprites.png 168 50 181 56 >> sb_sprites.inc
|
||||
$(HGR_SPRITE) -s -l bullet8_sprite sb_sprites.png 168 57 181 63 >> sb_sprites.inc
|
||||
$(HGR_SPRITE) -s -l bullet9_sprite sb_sprites.png 168 64 181 70 >> sb_sprites.inc
|
||||
$(HGR_SPRITE) -s -l bullet10_sprite sb_sprites.png 168 71 181 77 >> sb_sprites.inc
|
||||
$(HGR_SPRITE) -s -l bullet11_sprite sb_sprites.png 168 78 181 84 >> sb_sprites.inc
|
||||
$(HGR_SPRITE) -s -l bullet12_sprite sb_sprites.png 168 85 181 91 >> sb_sprites.inc
|
||||
$(HGR_SPRITE) -s -l bullet13_sprite sb_sprites.png 168 92 181 98 >> sb_sprites.inc
|
||||
$(HGR_SPRITE) -s -l bullet14_sprite sb_sprites.png 168 99 181 105 >> sb_sprites.inc
|
||||
$(HGR_SPRITE) -s -l bullet15_sprite sb_sprites.png 168 106 181 112 >> sb_sprites.inc
|
||||
|
||||
|
||||
|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 18 KiB |
@ -72,7 +72,9 @@ SHIELD_POSITION = $6E
|
||||
SHIELD_UP_RIGHT = 3
|
||||
SHIELD_COUNT = $6F
|
||||
BULLET_X = $70
|
||||
BULLET_Y = $71
|
||||
BULLET_X_L = $71
|
||||
BULLET_X_VEL = $72
|
||||
BULLET_Y = $73
|
||||
|
||||
.if 0
|
||||
REGISTER_DUMP = $70
|
||||
|
Loading…
x
Reference in New Issue
Block a user