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
This commit is contained in:
minjaesong
2018-10-05 23:40:03 +09:00
parent 5641910036
commit 83fd44df4c
36 changed files with 344 additions and 268 deletions

View File

@@ -13,9 +13,6 @@ import org.dyn4j.geometry.Vector2
internal object SpawnPhysTestBall : ConsoleCommand {
@Throws(Exception::class)
override fun execute(args: Array<String>) {
val world = (Terrarum.ingame!!.world)
val mouseX = Terrarum.mouseX
val mouseY = Terrarum.mouseY
@@ -25,7 +22,7 @@ internal object SpawnPhysTestBall : ConsoleCommand {
val xvel = args[2].toDouble()
val yvel = if (args.size >= 4) args[3].toDouble() else 0.0
val ball = PhysTestBall(world)
val ball = PhysTestBall()
ball.setPosition(mouseX, mouseY)
ball.elasticity = elasticity
ball.applyForce(Vector2(xvel, yvel))
@@ -35,7 +32,7 @@ internal object SpawnPhysTestBall : ConsoleCommand {
else if (args.size == 2) {
val elasticity = args[1].toDouble()
val ball = PhysTestBall(world)
val ball = PhysTestBall()
ball.setPosition(mouseX, mouseY)
ball.elasticity = elasticity