mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-13 03:54:06 +09:00
adopting Java 9/Kotlin 1.2
This commit is contained in:
@@ -54,6 +54,7 @@ object CommandDict {
|
||||
"spawntapestry" to SpawnTapestry,
|
||||
"imtest" to JavaIMTest,
|
||||
"cheatmotherfuckernootnoot" to CheatWarnTest,
|
||||
"spawnlunarlander" to SpawnPhysTestLunarLander,
|
||||
|
||||
|
||||
/* !! */"exportlayer" to ExportLayerData,
|
||||
|
||||
@@ -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)
|
||||
|
||||
24
src/net/torvald/terrarum/console/SpawnPhysTestLunarLander.kt
Normal file
24
src/net/torvald/terrarum/console/SpawnPhysTestLunarLander.kt
Normal 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")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user