add offset to projectile when player is attacking
This commit is contained in:
@@ -24,7 +24,7 @@ struct
|
|||||||
val recoilLimit = 15
|
val recoilLimit = 15
|
||||||
val attackedLimit = 55
|
val attackedLimit = 55
|
||||||
val maxCharge = 60
|
val maxCharge = 60
|
||||||
val mainAttackLimit = 25
|
val mainAttackLimit = 24
|
||||||
|
|
||||||
(* constants for projectiles *)
|
(* constants for projectiles *)
|
||||||
val projectilePi: Real32.real = Real32.Math.pi / 180.0
|
val projectilePi: Real32.real = Real32.Math.pi / 180.0
|
||||||
|
|||||||
@@ -149,12 +149,33 @@ struct
|
|||||||
fun helpGet (player: player, rx, ry, windowWidth, windowHeight) =
|
fun helpGet (player: player, rx, ry, windowWidth, windowHeight) =
|
||||||
case #mainAttack player of
|
case #mainAttack player of
|
||||||
MAIN_ATTACKING amt =>
|
MAIN_ATTACKING amt =>
|
||||||
let
|
(case #facing player of
|
||||||
val playerVec = PlayerAttackStandLeft.lerp (rx, ry, 3.0, windowWidth, windowHeight)
|
FACING_RIGHT =>
|
||||||
val projectileVec = Vector.fromList []
|
let
|
||||||
in
|
val playerVec = PlayerAttackStandLeft.lerp
|
||||||
playerVec
|
(rx, ry, 3.0, windowWidth, windowHeight)
|
||||||
end
|
|
||||||
|
val projY = ry + (Constants.playerHeightReal / 2.0)
|
||||||
|
val projX = rx + Constants.playerWidthReal
|
||||||
|
val func = Vector.sub (attackLeftProjectiles, amt)
|
||||||
|
val projectilesVec = func
|
||||||
|
(projX, projY, 3.0, windowWidth, windowHeight)
|
||||||
|
in
|
||||||
|
Vector.concat [playerVec, projectilesVec]
|
||||||
|
end
|
||||||
|
| FACING_LEFT =>
|
||||||
|
let
|
||||||
|
val playerVec = PlayerAttackStandLeft.lerp
|
||||||
|
(rx, ry, 3.0, windowWidth, windowHeight)
|
||||||
|
|
||||||
|
val projY = ry + (Constants.playerHeightReal / 2.0)
|
||||||
|
val projX = rx - Constants.playerWidthReal
|
||||||
|
val func = Vector.sub (attackLeftProjectiles, amt)
|
||||||
|
val projectilesVec = func
|
||||||
|
(projX, projY, 3.0, windowWidth, windowHeight)
|
||||||
|
in
|
||||||
|
Vector.concat [playerVec, projectilesVec]
|
||||||
|
end)
|
||||||
| _ =>
|
| _ =>
|
||||||
case #attacked player of
|
case #attacked player of
|
||||||
NOT_ATTACKED =>
|
NOT_ATTACKED =>
|
||||||
|
|||||||
Reference in New Issue
Block a user