|
|
@ -12,7 +12,6 @@ import com.badlogic.gdx.graphics.glutils.ShapeRenderer
|
|
|
|
import com.badlogic.gdx.math.MathUtils
|
|
|
|
import com.badlogic.gdx.math.MathUtils
|
|
|
|
import com.badlogic.gdx.math.Vector2
|
|
|
|
import com.badlogic.gdx.math.Vector2
|
|
|
|
import com.badlogic.gdx.math.Vector3
|
|
|
|
import com.badlogic.gdx.math.Vector3
|
|
|
|
import com.badlogic.gdx.scenes.scene2d.ui.Skin
|
|
|
|
|
|
|
|
import com.badlogic.gdx.utils.Json
|
|
|
|
import com.badlogic.gdx.utils.Json
|
|
|
|
import com.last.commit.Game
|
|
|
|
import com.last.commit.Game
|
|
|
|
import com.last.commit.Player
|
|
|
|
import com.last.commit.Player
|
|
|
@ -21,7 +20,6 @@ import com.last.commit.config.ActionCommand
|
|
|
|
import com.last.commit.config.GameConfig
|
|
|
|
import com.last.commit.config.GameConfig
|
|
|
|
import com.last.commit.map.Interactable
|
|
|
|
import com.last.commit.map.Interactable
|
|
|
|
import com.last.commit.map.TimeMap
|
|
|
|
import com.last.commit.map.TimeMap
|
|
|
|
import com.last.commit.stages.DialogStage
|
|
|
|
|
|
|
|
import com.last.commit.stages.UIStage
|
|
|
|
import com.last.commit.stages.UIStage
|
|
|
|
import kotlin.math.floor
|
|
|
|
import kotlin.math.floor
|
|
|
|
|
|
|
|
|
|
|
@ -48,7 +46,6 @@ class FirstScreen(private val parent: Game) : TimeTravelScreen() {
|
|
|
|
|
|
|
|
|
|
|
|
var pause = true
|
|
|
|
var pause = true
|
|
|
|
var uiStage: UIStage
|
|
|
|
var uiStage: UIStage
|
|
|
|
val dialogStage = DialogStage(Skin(Gdx.files.internal("ui/uiskin.json")))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
init {
|
|
|
|
init {
|
|
|
@ -70,7 +67,7 @@ class FirstScreen(private val parent: Game) : TimeTravelScreen() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
override fun getInputProcessors(): Array<InputProcessor> {
|
|
|
|
override fun getInputProcessors(): Array<InputProcessor> {
|
|
|
|
return arrayOf(dialogStage)
|
|
|
|
return arrayOf(gameState.dialogStage)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
override fun handleKeyInput(action: ActionCommand) {
|
|
|
|
override fun handleKeyInput(action: ActionCommand) {
|
|
|
@ -85,8 +82,8 @@ class FirstScreen(private val parent: Game) : TimeTravelScreen() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ActionCommand.JUMP -> {
|
|
|
|
ActionCommand.JUMP -> {
|
|
|
|
dialogStage.setTexts("Hello", "Please read the documentation")
|
|
|
|
gameState.dialogStage.setTexts("Hello", "Please read the documentation")
|
|
|
|
dialogStage.show()
|
|
|
|
gameState.dialogStage.show()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
else -> {}
|
|
|
|
else -> {}
|
|
|
@ -125,7 +122,7 @@ class FirstScreen(private val parent: Game) : TimeTravelScreen() {
|
|
|
|
override fun render(delta: Float) {
|
|
|
|
override fun render(delta: Float) {
|
|
|
|
if (!pause) {
|
|
|
|
if (!pause) {
|
|
|
|
uiStage.act(delta)
|
|
|
|
uiStage.act(delta)
|
|
|
|
dialogStage.act(delta)
|
|
|
|
gameState.dialogStage.act(delta)
|
|
|
|
handleInput(delta)
|
|
|
|
handleInput(delta)
|
|
|
|
handleMapBorderCollision()
|
|
|
|
handleMapBorderCollision()
|
|
|
|
|
|
|
|
|
|
|
@ -142,7 +139,7 @@ class FirstScreen(private val parent: Game) : TimeTravelScreen() {
|
|
|
|
renderInteractables(interactables)
|
|
|
|
renderInteractables(interactables)
|
|
|
|
|
|
|
|
|
|
|
|
uiStage.draw()
|
|
|
|
uiStage.draw()
|
|
|
|
dialogStage.draw()
|
|
|
|
gameState.dialogStage.draw()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -265,7 +262,7 @@ class FirstScreen(private val parent: Game) : TimeTravelScreen() {
|
|
|
|
override fun resize(width: Int, height: Int) {
|
|
|
|
override fun resize(width: Int, height: Int) {
|
|
|
|
// Resize your screen here. The parameters represent the new window size.
|
|
|
|
// Resize your screen here. The parameters represent the new window size.
|
|
|
|
uiStage.resize(width, height)
|
|
|
|
uiStage.resize(width, height)
|
|
|
|
dialogStage.resize(width, height)
|
|
|
|
gameState.dialogStage.resize(width, height)
|
|
|
|
handleRatioChange()
|
|
|
|
handleRatioChange()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|