mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-09 10:04:05 +09:00
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:
@@ -29,8 +29,6 @@ object ImportLayerData : ConsoleCommand {
|
||||
(Terrarum.ingame!!.world).spawnX * FeaturesDrawer.TILE_SIZE.toDouble()
|
||||
)
|
||||
|
||||
IngameRenderer.
|
||||
|
||||
Echo("Successfully loaded ${args[1]}")
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ internal object SpawnPhysTestLunarLander : ConsoleCommand {
|
||||
override fun execute(args: Array<String>) {
|
||||
val mouseX = Terrarum.mouseX
|
||||
val mouseY = Terrarum.mouseY
|
||||
val lander = PhysTestLuarLander((Terrarum.ingame!!.world))
|
||||
val lander = PhysTestLuarLander()
|
||||
|
||||
lander.setPosition(mouseX, mouseY)
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import net.torvald.terrarum.modulebasegame.gameactors.FixtureTikiTorch
|
||||
*/
|
||||
internal object SpawnTikiTorch : ConsoleCommand {
|
||||
override fun execute(args: Array<String>) {
|
||||
val torch = FixtureTikiTorch((Terrarum.ingame!!.world))
|
||||
val torch = FixtureTikiTorch()
|
||||
torch.setPosition(Terrarum.mouseX, Terrarum.mouseY)
|
||||
|
||||
Terrarum.ingame!!.addNewActor(torch)
|
||||
|
||||
Reference in New Issue
Block a user