Physics stuff Float -> Double

Former-commit-id: 54ccee75769691aa6aaa2416767bd15270f63347
Former-commit-id: 61e892434f48adf11e3ca49b60928a930fd5cde9
This commit is contained in:
Song Minjae
2016-05-01 00:23:36 +09:00
parent fba0b80d24
commit c9f5fde3be
26 changed files with 225 additions and 291 deletions

View File

@@ -20,7 +20,7 @@ internal class SetAV : ConsoleCommand {
echo.execute("${ccW}Set actor value of specific target to desired value.")
echo.execute("${ccW}Usage: ${ccY}setav ${ccG}(id) <av> <val>")
echo.execute("${ccW}blank ID for player")
echo.execute("${ccR}Contaminated (float -> string) ActorValue will crash the game,")
echo.execute("${ccR}Contaminated (double -> string) ActorValue will crash the game,")
echo.execute("${ccR}so make sure it will not happen before you issue the command!")
echo.execute("${ccW}Use ${ccG}__true ${ccW}and ${ccG}__false ${ccW}for boolean value.")
}
@@ -35,7 +35,7 @@ internal class SetAV : ConsoleCommand {
catch (e: NumberFormatException) {
try {
`val` = arg.toFloat() // try for float
`val` = arg.toDouble() // try for double
}
catch (ee: NumberFormatException) {
if (arg.equals("__true", ignoreCase = true)) {

View File

@@ -16,12 +16,12 @@ class SpawnPhysTestBall : ConsoleCommand {
val mouseX = Terrarum.appgc.input.mouseX
val mouseY = Terrarum.appgc.input.mouseY
val elasticity = args[1].toFloat()
val elasticity = args[1].toDouble()
val ball = PhysTestBall()
ball.setPosition(
(mouseX + MapCamera.cameraX).toFloat(),
(mouseY + MapCamera.cameraY).toFloat()
(mouseX + MapCamera.cameraX).toDouble(),
(mouseY + MapCamera.cameraY).toDouble()
)
ball.elasticity = elasticity

View File

@@ -26,7 +26,7 @@ class TeleportPlayer : ConsoleCommand {
return
}
Terrarum.game.player.setPosition(x.toFloat(), y.toFloat())
Terrarum.game.player.setPosition(x.toDouble(), y.toDouble())
}
}