LibGDX, here I am.

This commit is contained in:
minjaesong
2017-06-22 02:31:07 +09:00
parent 1ecbc57f83
commit ad481853bb
356 changed files with 3125 additions and 21138 deletions

View File

@@ -1,10 +1,11 @@
package net.torvald.terrarum.blockstats
import com.badlogic.gdx.Gdx
import net.torvald.terrarum.gameworld.GameWorld
import net.torvald.terrarum.gameworld.MapLayer
import net.torvald.terrarum.worlddrawer.BlocksDrawer
import net.torvald.terrarum.worlddrawer.FeaturesDrawer
import net.torvald.terrarum.Terrarum
import net.torvald.terrarum.TerrarumGDX
import com.jme3.math.FastMath
import java.util.Arrays
@@ -26,11 +27,11 @@ object BlockStats {
// Get stats on no-zoomed screen area. In other words, will behave as if screen zoom were 1.0
// no matter how the screen is zoomed.
val map = Terrarum.ingame!!.world
val player = Terrarum.ingame!!.player
val map = TerrarumGDX.ingame!!.world
val player = TerrarumGDX.ingame!!.player
val renderWidth = FastMath.ceil(Terrarum.WIDTH.toFloat())
val renderHeight = FastMath.ceil(Terrarum.HEIGHT.toFloat())
val renderWidth = FastMath.ceil(Gdx.graphics.width.toFloat())
val renderHeight = FastMath.ceil(Gdx.graphics.height.toFloat())
val noZoomCameraX = Math.round(FastMath.clamp(
(player?.hitbox?.centeredX?.toFloat() ?: 0f) - renderWidth / 2, TSIZE.toFloat(), map.width * TSIZE - renderWidth - TSIZE.toFloat()))