fixing "roundworld anomaly": some actors won't render

This commit is contained in:
minjaesong
2019-05-31 04:10:00 +09:00
parent a595dc2665
commit 874834b2d1
4 changed files with 69 additions and 44 deletions

View File

@@ -17,6 +17,10 @@ object WorldCamera {
private set
var y: Int = 0 // top position
private set
var xEnd: Int = 0 // right position
private set
var yEnd: Int = 0 // bottom position
private set
inline val gdxCamX: Float // centre position
get() = xCentre.toFloat()
inline val gdxCamY: Float// centre position
@@ -53,6 +57,8 @@ object WorldCamera {
world.height * TILE_SIZE - height - TILE_SIZE.toFloat()
)).floorInt().clampCameraY(world)
xEnd = x + width
yEnd = y + height
}
private fun Int.clampCameraY(world: GameWorld): Int {