Format head rotation code

This commit is contained in:
scawful
2024-03-30 11:51:49 -04:00
parent 2e5a5908c0
commit 8c0dc13f1f

View File

@@ -186,7 +186,7 @@ Sprite_KydreeokHead_Main:
CoordinateBasedRotation: CoordinateBasedRotation:
{ {
LDA Neck_Index : TAY LDA Neck_Index : TAY
; JSL GetRandomInt : AND #$04 : TAY ; JSL GetRandomInt : AND #$04 : TAY
; LDA X_Coords, Y : STA Neck1_OffsetX ; LDA X_Coords, Y : STA Neck1_OffsetX
; JSL GetRandomInt : AND #$04 : TAY ; JSL GetRandomInt : AND #$04 : TAY
@@ -196,21 +196,25 @@ CoordinateBasedRotation:
; JSL GetRandomInt : AND #$04 : TAY ; JSL GetRandomInt : AND #$04 : TAY
LDA Y_Coords, Y : STA Neck2_OffsetY LDA Y_Coords, Y : STA Neck2_OffsetY
JSL GetRandomInt : AND #$3F : BNE .dont_increment JSL GetRandomInt : AND #$3F : BNE .dont_increment
INC.w Neck_Index INC.w Neck_Index
.dont_increment .dont_increment
CPY #15 : BNE .not_full CPY #15 : BNE .not_full
LDA #0 : STA Neck_Index LDA #0 : STA Neck_Index
.not_full .not_full
RTS RTS
} }
; Table for X coordinates (based on a radius of 8) ; Table for X coordinates (based on a radius of 8)
X_Coords: X_Coords:
db 8, 11, 8, 3, -4, -9, -12, -9, -4, 3, 8, 11, 8, 3, -4, -9 ; X values db 8, 11, 8, 3, -4, -9, -12, -9
db -4, 3, 8, 11, 8, 3, -4, -9
; Table for Y coordinates (based on a radius of 8) ; Table for Y coordinates (based on a radius of 8)
Y_Coords: Y_Coords:
db 0, -3, -8, -11, -15, -15, -11, -8, -3, 0, 3, 8, 11, 15, 15, 11 ; Y values db 0, -3, -8, -11, -15, -15, -11, -8
db -3, 0, 3, 8, 11, 15, 15, 11
; =========================================================
RotateHeadUsingSpeedValues: RotateHeadUsingSpeedValues:
{ {
@@ -220,7 +224,7 @@ RotateHeadUsingSpeedValues:
LDA.w SprYSpeed, X : CLC : ADC.w YSpeedSin, Y : ASL : STA.w SprYSpeed, X LDA.w SprYSpeed, X : CLC : ADC.w YSpeedSin, Y : ASL : STA.w SprYSpeed, X
INY : CPY #$3F : BNE .not_full INY : CPY #$3F : BNE .not_full
LDY.b #$00 LDY.b #$00
.not_full .not_full
STY.w Neck_Index STY.w Neck_Index
JSL Sprite_MoveLong JSL Sprite_MoveLong
@@ -229,22 +233,29 @@ RotateHeadUsingSpeedValues:
} }
XSpeedSin: XSpeedSin:
db 0, 3, 6, 9, 12, 15, 18, 20, 23, 25 {
db 27, 28, 30, 31, 31, 32 db 0, 3, 6, 9, 12, 15, 18, 20, 23, 25
db 27, 28, 30, 31, 31, 32
}
YSpeedSin: YSpeedSin:
db 32, 32, 31, 31 {
db 30, 28, 27, 25, 23, 20, 18, 15, 12, 9 db 32, 32, 31, 31
db 6, 3, 0, -3, -6, -9, -12, -15, -18, -20 db 30, 28, 27, 25, 23, 20, 18, 15, 12, 9
db -23, -25, -27, -28, -30, -31, -31, -32, -32, -32 db 6, 3, 0, -3, -6, -9, -12, -15, -18, -20
db -31, -31, -30, -28, -27, -25, -23, -20, -18, -15 db -23, -25, -27, -28, -30, -31, -31, -32, -32, -32
db -12, -9, -6, -3 db -31, -31, -30, -28, -27, -25, -23, -20, -18, -15
db 0, 3, 6, 9, 12, 15, 18, 20, 23, 25 db -12, -9, -6, -3
db 27, 28, 30, 31, 31, 32, 32, 32, 31, 31 db 0, 3, 6, 9, 12, 15, 18, 20, 23, 25
db 30, 28, 27, 25, 23, 20, 18, 15, 12, 9 db 27, 28, 30, 31, 31, 32, 32, 32, 31, 31
db 6, 3, 0, -3, -6, -9, -12, -15, -18, -20 db 30, 28, 27, 25, 23, 20, 18, 15, 12, 9
db -23, -25, -27, -28, -30, -31, -31, -32, -32, -32 db 6, 3, 0, -3, -6, -9, -12, -15, -18, -20
db -31, -31, -30, -28, -27, -25, -23, -20, -18, -15 db -23, -25, -27, -28, -30, -31, -31, -32, -32, -32
db -12, -9, -6, -3 db -31, -31, -30, -28, -27, -25, -23, -20, -18, -15
db -12, -9, -6, -3
}
; =========================================================
RandomlyAttack: RandomlyAttack:
{ {