diff --git a/WitchQueen/core/src/main/kotlin/com/iofferyoutea/WitchQueen/Game.kt b/WitchQueen/core/src/main/kotlin/com/iofferyoutea/WitchQueen/Game.kt new file mode 100644 index 0000000..118d5dd --- /dev/null +++ b/WitchQueen/core/src/main/kotlin/com/iofferyoutea/WitchQueen/Game.kt @@ -0,0 +1,4 @@ +package com.iofferyoutea.WitchQueen + +class Game(val clients: Array) { +} diff --git a/WitchQueen/core/src/main/kotlin/com/iofferyoutea/WitchQueen/Main.kt b/WitchQueen/core/src/main/kotlin/com/iofferyoutea/WitchQueen/Main.kt index 6e1ed72..5c9d4f7 100644 --- a/WitchQueen/core/src/main/kotlin/com/iofferyoutea/WitchQueen/Main.kt +++ b/WitchQueen/core/src/main/kotlin/com/iofferyoutea/WitchQueen/Main.kt @@ -17,8 +17,8 @@ class Main : KtxGame() { override fun create() { KtxAsync.initiate() - addScreen(FirstScreen()) - setScreen() + addScreen(MainMenu()) + setScreen() } } diff --git a/WitchQueen/core/src/main/kotlin/com/iofferyoutea/WitchQueen/MainMenu.kt b/WitchQueen/core/src/main/kotlin/com/iofferyoutea/WitchQueen/MainMenu.kt new file mode 100644 index 0000000..5795a38 --- /dev/null +++ b/WitchQueen/core/src/main/kotlin/com/iofferyoutea/WitchQueen/MainMenu.kt @@ -0,0 +1,84 @@ +package com.iofferyoutea.WitchQueen + +import com.badlogic.gdx.Gdx +import com.badlogic.gdx.graphics.Texture +import com.badlogic.gdx.graphics.g2d.BitmapFont +import com.badlogic.gdx.scenes.scene2d.Actor +import com.badlogic.gdx.scenes.scene2d.Stage +import com.badlogic.gdx.scenes.scene2d.ui.Container +import com.badlogic.gdx.scenes.scene2d.ui.Table +import com.badlogic.gdx.scenes.scene2d.ui.TextButton +import com.badlogic.gdx.scenes.scene2d.ui.VerticalGroup +import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable +import ktx.app.KtxScreen +import ktx.app.clearScreen +import org.w3c.dom.Text + +class MainMenu : KtxScreen { + val table = Table().apply { + debug = true + setFillParent(true) + } + val stage = Stage().apply { + Gdx.input.inputProcessor = this + addActor(table) + } + + // Default + val defaultButtonTrd = TextureRegionDrawable(Texture("default.png")) + val flippedDefaultButtonTrd = TextureRegionDrawable(Texture("default_flipped.png")) + val defaultTextButtonStyle = TextButton.TextButtonStyle ( + defaultButtonTrd, + flippedDefaultButtonTrd, + defaultButtonTrd, + BitmapFont() + ) + + // Map + + // Lobby + // Start off only showing Host and Join button. When selected show menu for that option. + // Host is normal lobby + // Join will bring up menu with games on local network + val hostButton = TextButton("Host", defaultTextButtonStyle) + val joinButton = TextButton("Join", defaultTextButtonStyle) + val hostOrJoinVerticalGroup = VerticalGroup().apply { + addActor(hostButton) + addActor(joinButton) + } + val lobbyContainer = Container(hostOrJoinVerticalGroup).apply { + table.add(this) + } + + //region Play + val casualButton = TextButton("Casual", defaultTextButtonStyle).apply { + table.row() + table.add(this) + } + //endregion + + private fun update(delta: Float) { + if (hostButton.isPressed) { + Gdx.app.log("MainMenu", "Host button pressed") + } + if (joinButton.isPressed) { + Gdx.app.log("MainMenu", "Join button pressed") + } + if (casualButton.isPressed) { + Gdx.app.log("MainMenu", "Casual button pressed") + } + } + + override fun render(delta: Float) { + clearScreen(0f,0f, 0f) + + update(delta) + + stage.act(delta) + stage.draw() + } + + override fun dispose() { + stage.dispose() + } +} diff --git a/WitchQueen/core/src/main/kotlin/com/iofferyoutea/WitchQueen/Map.kt b/WitchQueen/core/src/main/kotlin/com/iofferyoutea/WitchQueen/Map.kt index 0879e37..bdef803 100644 --- a/WitchQueen/core/src/main/kotlin/com/iofferyoutea/WitchQueen/Map.kt +++ b/WitchQueen/core/src/main/kotlin/com/iofferyoutea/WitchQueen/Map.kt @@ -1,6 +1,6 @@ package com.iofferyoutea.WitchQueen class Map(val mapType: MapType) { - val rooms = Array(2) { Array(2) { Room.new } } // We use an array instead of list i think - + val rooms = Array(2) { Array(2) { Room(mapType) } } // We use an array instead of list i think + } diff --git a/WitchQueen/core/src/main/kotlin/com/iofferyoutea/WitchQueen/Player.kt b/WitchQueen/core/src/main/kotlin/com/iofferyoutea/WitchQueen/Player.kt index 1368769..d8e7d9b 100644 --- a/WitchQueen/core/src/main/kotlin/com/iofferyoutea/WitchQueen/Player.kt +++ b/WitchQueen/core/src/main/kotlin/com/iofferyoutea/WitchQueen/Player.kt @@ -6,5 +6,5 @@ enum class PlayerState { class Player(val map: Map) { var currentState = PlayerState.IDLE - val currentRoom + val currentRoom = arrayOf(0, 0) // Make this a spawn room or something }