diff --git a/fcore/constants.sml b/fcore/constants.sml index 44d1ede..246042c 100644 --- a/fcore/constants.sml +++ b/fcore/constants.sml @@ -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 diff --git a/fcore/level/player/player-vec.sml b/fcore/level/player/player-vec.sml index d5d83fc..3c171fe 100644 --- a/fcore/level/player/player-vec.sml +++ b/fcore/level/player/player-vec.sml @@ -149,12 +149,33 @@ struct fun helpGet (player: player, rx, ry, windowWidth, windowHeight) = case #mainAttack player of MAIN_ATTACKING amt => - let - val playerVec = PlayerAttackStandLeft.lerp (rx, ry, 3.0, windowWidth, windowHeight) - val projectileVec = Vector.fromList [] - in - playerVec - end + (case #facing player of + FACING_RIGHT => + 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 + | 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 =>