diff --git a/fcore/level/player/player-vec.sml b/fcore/level/player/player-vec.sml index 915f87b..bd48159 100644 --- a/fcore/level/player/player-vec.sml +++ b/fcore/level/player/player-vec.sml @@ -155,8 +155,9 @@ struct val playerVec = PlayerAttackStandRight.lerp (rx, ry, 3.0, windowWidth, windowHeight) - (* todo: why does 81 work to give perfect alignment? *) - val projX = x + 81 + (* adding playerWidth to x so that projectile starts from + * the rightmost pixel of the player *) + val projX = x + Constants.playerWidth val projY = y + (Constants.playerHeight div 3) val projX = (Real32.fromInt projX + xOffset) * ratio val projY = (Real32.fromInt projY + yOffset) * ratio @@ -172,6 +173,10 @@ struct val playerVec = PlayerAttackStandLeft.lerp (rx, ry, 3.0, windowWidth, windowHeight) + (* subtracting playerHeight from x because projectile + * is the same size as the playerHeight, and it looks like + * the projectile starts from player's leftmost side this way. + * *) val projX = x - Constants.playerHeight val projY = y + (Constants.playerHeight div 3) val projX = (Real32.fromInt projX + xOffset) * ratio