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