Files
Terrarum/src/net/torvald/terrarum/modulebasegame/console/SpawnPhysTestLunarLander.kt
minjaesong 83fd44df4c abolished a need to pass world as parametre
+ simply changing the single variable (ingame.world) will update all the renderer's behaviour
+ somehow my git changelogs are exploding
2018-10-05 23:40:03 +09:00

26 lines
758 B
Kotlin

package net.torvald.terrarum.modulebasegame.console
import net.torvald.terrarum.Terrarum
import net.torvald.terrarum.console.ConsoleCommand
import net.torvald.terrarum.console.Echo
import net.torvald.terrarum.modulebasegame.Ingame
import net.torvald.terrarum.modulebasegame.gameactors.PhysTestLuarLander
/**
* 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()
lander.setPosition(mouseX, mouseY)
Terrarum.ingame!!.addNewActor(lander)
}
override fun printUsage() {
Echo("control it with arrow keys")
}
}