the world is being unflipped wip

This commit is contained in:
minjaesong
2021-12-13 13:05:23 +09:00
parent 1057f40fba
commit 83f78edc2a
7 changed files with 25 additions and 27 deletions

View File

@@ -1650,11 +1650,11 @@ open class ActorWithBody : Actor {
protected fun drawSpriteInGoodPosition(sprite: SpriteAnimation, batch: SpriteBatch) {
if (world == null) return
val offsetX = (hitboxTranslateX * scale).toFloat()
val offsetY = (sprite.cellHeight * scale - hitbox.height - hitboxTranslateY * scale - 1).toFloat()
val offsetX = 0f
val offsetY = 1f // plant to the ground
drawBodyInGoodPosition(hitbox.startX.toFloat(), hitbox.startY.toFloat()) { x, y ->
sprite.render(batch, x - offsetX, y - offsetY, scale.toFloat())
sprite.render(batch, x + offsetX, y + offsetY, scale.toFloat())
}
}