fixed a bug where wires were actually drawn upside-down; 10base2 wires are now terminated

This commit is contained in:
minjaesong
2021-08-16 20:55:10 +09:00
parent d611638851
commit 74ae35e9a9
3 changed files with 7 additions and 6 deletions

Binary file not shown.

View File

@@ -25,7 +25,7 @@ class WireActor(id: ActorID) : ActorWithBody(RenderOrder.WIRES, PhysProperties.I
init {
referenceID = id
setHitboxDimension(2, 2, 0, 0)
setHitboxDimension(TILE_SIZE, TILE_SIZE, 0, 0)
}
private var wireID = ""
@@ -63,14 +63,15 @@ class WireActor(id: ActorID) : ActorWithBody(RenderOrder.WIRES, PhysProperties.I
}
}
sprite!!.currentFrame = ret
sprite!!.flipVertical = true // turns out the sprites are rendered upside-down by default :(
}
private fun getNearbyTilesPos(x: Int, y: Int): Array<Point2i> {
return arrayOf(
Point2i(x + 1, y),
Point2i(x, y - 1),
Point2i(x, y + 1),
Point2i(x - 1, y),
Point2i(x, y + 1) // don't know why but it doesn't work if I don't flip Y
Point2i(x, y - 1)
)
}