Fixed a nasty bug in cratering

This commit is contained in:
blondie7575 2018-06-11 18:01:19 -06:00
parent a5e4c3e143
commit 62fc459fba
3 changed files with 7 additions and 3 deletions

Binary file not shown.

View File

@ -39,7 +39,7 @@ GRAVITY = $ffff ; 8.8 fixed point
projectileTypes:
; Spit
.word 3 ; Damage
.word 9 ; Crater radius
.word 3 ; Crater radius
.word 4 ; Frame 0
.word 5 ; Frame 1
.word 6 ; Frame 2

View File

@ -63,7 +63,7 @@ renderTerrainDone:
;
; PARAML0 = X pos of center in pixels from logical left terrain edge
; PARAML1 = Y pos of center in pixels from bottom terrain edge
; Y = Radius of circle, in pixels
; Y = Radius of circle, in pixels (minimum is 3)
;
; Trashes SCRATCHL
craterTerrain:
@ -74,15 +74,19 @@ craterTerrain:
sbc PARAML0
sty SCRATCHL ; Center width in bytes
sbc SCRATCHL
sbc SCRATCHL
and #$fffe ; Force even
clc
adc #terrainData
sta PARAML0
tya
asl
tay
lda circleTable,y ; Look up circle data
sta SCRATCHL
tya ; Iterate over diameter
tya ; Iterate over diameter words
asl
tay