|
|
|
@ -1,7 +1,6 @@
|
|
|
|
|
package com.last.commit.screen
|
|
|
|
|
|
|
|
|
|
import com.badlogic.gdx.Gdx
|
|
|
|
|
import com.badlogic.gdx.Input
|
|
|
|
|
import com.badlogic.gdx.graphics.Color
|
|
|
|
|
import com.badlogic.gdx.graphics.GL20
|
|
|
|
|
import com.badlogic.gdx.graphics.OrthographicCamera
|
|
|
|
@ -65,18 +64,20 @@ class FirstScreen(private val parent: Game) : TimeTravelScreen() {
|
|
|
|
|
gameState.soundEngine.play(GameMusic.WORLD_MUSIC, 0.25f)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override fun handleKeyInput(action: ActionCommand) {
|
|
|
|
|
if (!pause) {
|
|
|
|
|
when (action) {
|
|
|
|
|
ActionCommand.INTERACT -> {
|
|
|
|
|
openDoor()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ActionCommand.TIME_TRAVEL -> {
|
|
|
|
|
map.teleport(player)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else -> {}
|
|
|
|
|
}
|
|
|
|
|
println(action)
|
|
|
|
|
if (action == ActionCommand.OPEN_MENU) {
|
|
|
|
|
//Gdx.app.exit()
|
|
|
|
|
parent.changeScreen(Screens.MAIN_MENU)
|
|
|
|
@ -89,10 +90,8 @@ class FirstScreen(private val parent: Game) : TimeTravelScreen() {
|
|
|
|
|
if (!pause) {
|
|
|
|
|
|
|
|
|
|
val mouseCoordinates: Vector2 = toWorldCoordinates(screenX.toFloat(), screenY.toFloat())
|
|
|
|
|
println("Mouse World coordinates is ${mouseCoordinates.x}:${mouseCoordinates.y}")
|
|
|
|
|
val playerDirection: Vector2 = player.getAbsoluteDirection()
|
|
|
|
|
|
|
|
|
|
println("Player interactor is ${playerDirection.x}:${playerDirection.y}")
|
|
|
|
|
map.interactWith(playerDirection.x, playerDirection.y, player.getCollider())
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -295,7 +294,6 @@ class FirstScreen(private val parent: Game) : TimeTravelScreen() {
|
|
|
|
|
fun openDoor() {
|
|
|
|
|
println("Attempt to toggle door")
|
|
|
|
|
val playerDirection: Vector2 = player.getAbsoluteDirection()
|
|
|
|
|
println("Player interactor is ${playerDirection.x}:${playerDirection.y}")
|
|
|
|
|
map.interactWith(playerDirection.x, playerDirection.y, player.getCollider())
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|