HandleLiftAndToss movement speed based on link direction
This commit is contained in:
@@ -177,16 +177,33 @@ macro StopCart()
|
|||||||
STZ.w !LinkInCart
|
STZ.w !LinkInCart
|
||||||
endmacro
|
endmacro
|
||||||
|
|
||||||
; TODO: Implement distance and gravity for cart tossing
|
HandleLiftAndToss:
|
||||||
macro HandleLiftAndToss()
|
{
|
||||||
LDA.w !LinkCarryOrToss : AND #$02 : BNE .not_tossing
|
LDA.w !LinkCarryOrToss : CMP.b #$02 : BNE .not_tossing
|
||||||
; Velocities for cart tossing
|
; Check links facing direction $2F and apply velocity
|
||||||
STZ.w SprXSpeed, X : STZ.w SprYSpeed, X
|
LDA $2F : CMP.b #$00 : BEQ .toss_north
|
||||||
STZ.w $0F90, X : STZ.w $0F70, X
|
CMP.b #$02 : BEQ .toss_south
|
||||||
|
CMP.b #$04 : BEQ .toss_east
|
||||||
|
CMP.b #$06 : BEQ .toss_west
|
||||||
|
.toss_north
|
||||||
|
LDA.b #-!MinecartSpeed : STA SprYSpeed, X
|
||||||
|
JMP .continue
|
||||||
|
.toss_south
|
||||||
|
LDA.b #!MinecartSpeed : STA SprYSpeed, X
|
||||||
|
JMP .continue
|
||||||
|
.toss_east
|
||||||
|
LDA.b #-!MinecartSpeed : STA SprXSpeed, X
|
||||||
|
JMP .continue
|
||||||
|
.toss_west
|
||||||
|
LDA.b #!MinecartSpeed : STA SprXSpeed, X
|
||||||
|
.continue
|
||||||
|
LDA #$0F : STA SprTimerB, X
|
||||||
.not_tossing
|
.not_tossing
|
||||||
JSL Sprite_CheckIfLifted
|
JSL Sprite_CheckIfLifted
|
||||||
JSL Sprite_MoveXyz
|
JSL Sprite_MoveXyz
|
||||||
endmacro
|
RTS
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
; =========================================================
|
; =========================================================
|
||||||
|
|
||||||
@@ -230,10 +247,11 @@ Sprite_Minecart_Main:
|
|||||||
STA.w !MinecartDirection
|
STA.w !MinecartDirection
|
||||||
LDA #$03 : STA !SpriteDirection, X
|
LDA #$03 : STA !SpriteDirection, X
|
||||||
%GotoAction(3) ; Minecart_MoveEast
|
%GotoAction(3) ; Minecart_MoveEast
|
||||||
|
RTS
|
||||||
|
|
||||||
.not_ready
|
.not_ready
|
||||||
.lifting
|
.lifting
|
||||||
%HandleLiftAndToss()
|
JSR HandleLiftAndToss
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -264,10 +282,11 @@ Sprite_Minecart_Main:
|
|||||||
STA.w !MinecartDirection
|
STA.w !MinecartDirection
|
||||||
LDA #$00 : STA !SpriteDirection, X
|
LDA #$00 : STA !SpriteDirection, X
|
||||||
%GotoAction(2) ; Minecart_MoveNorth
|
%GotoAction(2) ; Minecart_MoveNorth
|
||||||
|
RTS
|
||||||
|
|
||||||
.not_ready
|
.not_ready
|
||||||
.lifting
|
.lifting
|
||||||
%HandleLiftAndToss()
|
JSR HandleLiftAndToss
|
||||||
RTS
|
RTS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user