mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-14 04:24:05 +09:00
fixed a bug where player position would offset to right on load
This commit is contained in:
@@ -390,11 +390,7 @@ open class ActorWithBody : Actor {
|
|||||||
* @param y
|
* @param y
|
||||||
*/
|
*/
|
||||||
fun setPosition(x: Double, y: Double) {
|
fun setPosition(x: Double, y: Double) {
|
||||||
hitbox.setFromWidthHeight(
|
hitbox.setPositionFromPointed(x, y)
|
||||||
x - (baseHitboxW / 2 - hitboxTranslateX) * scale,
|
|
||||||
y - (baseHitboxH - hitboxTranslateY) * scale,
|
|
||||||
baseHitboxW * scale,
|
|
||||||
baseHitboxH * scale)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// get() methods are moved to update(), too much stray object being created is definitely not good
|
// get() methods are moved to update(), too much stray object being created is definitely not good
|
||||||
|
|||||||
Reference in New Issue
Block a user