adopting Java 9/Kotlin 1.2

This commit is contained in:
minjaesong
2018-02-10 21:40:17 +09:00
parent 941d9fa107
commit 40423ede52
31 changed files with 326 additions and 69 deletions

View File

@@ -54,6 +54,7 @@ object CommandDict {
"spawntapestry" to SpawnTapestry,
"imtest" to JavaIMTest,
"cheatmotherfuckernootnoot" to CheatWarnTest,
"spawnlunarlander" to SpawnPhysTestLunarLander,
/* !! */"exportlayer" to ExportLayerData,

View File

@@ -21,10 +21,7 @@ internal object SpawnPhysTestBall : ConsoleCommand {
val yvel = if (args.size >= 4) args[3].toDouble() else 0.0
val ball = PhysTestBall(Terrarum.ingame!!.world)
ball.setPosition(
(mouseX + WorldCamera.x).toDouble(),
(mouseY + WorldCamera.y).toDouble()
)
ball.setPosition(mouseX, mouseY)
ball.elasticity = elasticity
ball.applyForce(Vector2(xvel, yvel))
@@ -34,10 +31,7 @@ internal object SpawnPhysTestBall : ConsoleCommand {
val elasticity = args[1].toDouble()
val ball = PhysTestBall(Terrarum.ingame!!.world)
ball.setPosition(
(mouseX + WorldCamera.x).toDouble(),
(mouseY + WorldCamera.y).toDouble()
)
ball.setPosition(mouseX, mouseY)
ball.elasticity = elasticity
Terrarum.ingame!!.addNewActor(ball)

View File

@@ -0,0 +1,24 @@
package net.torvald.terrarum.console
import net.torvald.terrarum.Terrarum
import net.torvald.terrarum.gameactors.PhysTestLuarLander
import net.torvald.terrarum.worlddrawer.WorldCamera
/**
* Created by minjaesong on 2018-01-18.
*/
internal object SpawnPhysTestLunarLander : ConsoleCommand {
override fun execute(args: Array<String>) {
val mouseX = Terrarum.mouseX
val mouseY = Terrarum.mouseY
val lander = PhysTestLuarLander(Terrarum.ingame!!.world)
lander.setPosition(mouseX, mouseY)
Terrarum.ingame!!.addNewActor(lander)
}
override fun printUsage() {
Echo("control it with arrow keys")
}
}