fixed a bug where player position would offset to right on load

This commit is contained in:
minjaesong
2021-10-14 01:34:49 +09:00
parent 3c2564ca64
commit 0913937ba2

View File

@@ -390,11 +390,7 @@ open class ActorWithBody : Actor {
* @param y
*/
fun setPosition(x: Double, y: Double) {
hitbox.setFromWidthHeight(
x - (baseHitboxW / 2 - hitboxTranslateX) * scale,
y - (baseHitboxH - hitboxTranslateY) * scale,
baseHitboxW * scale,
baseHitboxH * scale)
hitbox.setPositionFromPointed(x, y)
}
// get() methods are moved to update(), too much stray object being created is definitely not good