mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 19:44:05 +09:00
separated Camera from TileDrawer (was MapCamera)
Former-commit-id: b2fe7716722634b03f3750fade420d26022500f9 Former-commit-id: 521826d176c6902007646e6b9b9c7b5d4f3468cf
This commit is contained in:
@@ -3,8 +3,9 @@ package net.torvald.terrarum.console
|
||||
import net.torvald.terrarum.gameactors.Actor
|
||||
import net.torvald.terrarum.gameactors.ActorWithBody
|
||||
import net.torvald.terrarum.gameactors.PhysTestBall
|
||||
import net.torvald.terrarum.mapdrawer.MapCamera
|
||||
import net.torvald.terrarum.mapdrawer.TilesDrawer
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.mapdrawer.MapCamera
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 16-03-05.
|
||||
@@ -20,8 +21,8 @@ internal object SpawnPhysTestBall : ConsoleCommand {
|
||||
|
||||
val ball = PhysTestBall()
|
||||
ball.setPosition(
|
||||
(mouseX + MapCamera.cameraX).toDouble(),
|
||||
(mouseY + MapCamera.cameraY).toDouble()
|
||||
(mouseX + MapCamera.x).toDouble(),
|
||||
(mouseY + MapCamera.y).toDouble()
|
||||
)
|
||||
ball.elasticity = elasticity
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package net.torvald.terrarum.console
|
||||
|
||||
import net.torvald.terrarum.StateInGame
|
||||
import net.torvald.terrarum.mapdrawer.MapDrawer
|
||||
import net.torvald.terrarum.mapdrawer.FeaturesDrawer
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.gameactors.ActorWithBody
|
||||
|
||||
@@ -16,8 +16,8 @@ internal object Teleport : ConsoleCommand {
|
||||
val x: Int
|
||||
val y: Int
|
||||
try {
|
||||
x = args[1].toInt() * MapDrawer.TILE_SIZE + MapDrawer.TILE_SIZE / 2
|
||||
y = args[2].toInt() * MapDrawer.TILE_SIZE + MapDrawer.TILE_SIZE / 2
|
||||
x = args[1].toInt() * FeaturesDrawer.TILE_SIZE + FeaturesDrawer.TILE_SIZE / 2
|
||||
y = args[2].toInt() * FeaturesDrawer.TILE_SIZE + FeaturesDrawer.TILE_SIZE / 2
|
||||
}
|
||||
catch (e: NumberFormatException) {
|
||||
EchoError("Teleport: wrong number input.")
|
||||
@@ -76,8 +76,8 @@ internal object Teleport : ConsoleCommand {
|
||||
val x: Int
|
||||
val y: Int
|
||||
try {
|
||||
x = args[3].toInt() * MapDrawer.TILE_SIZE + MapDrawer.TILE_SIZE / 2
|
||||
y = args[4].toInt() * MapDrawer.TILE_SIZE + MapDrawer.TILE_SIZE / 2
|
||||
x = args[3].toInt() * FeaturesDrawer.TILE_SIZE + FeaturesDrawer.TILE_SIZE / 2
|
||||
y = args[4].toInt() * FeaturesDrawer.TILE_SIZE + FeaturesDrawer.TILE_SIZE / 2
|
||||
val actorID = args[1].toInt()
|
||||
|
||||
if (Terrarum.ingame.getActorByID(actorID) !is ActorWithBody) {
|
||||
|
||||
Reference in New Issue
Block a user