Compare commits

..

5 Commits

5 changed files with 67 additions and 5 deletions

View File

@@ -0,0 +1,4 @@
package com.iofferyoutea.WitchQueen
class Game(val clients: Array<Client>) {
}

View File

@@ -17,8 +17,8 @@ class Main : KtxGame<KtxScreen>() {
override fun create() {
KtxAsync.initiate()
addScreen(FirstScreen())
setScreen<FirstScreen>()
addScreen(MainMenu())
setScreen<MainMenu>()
}
}

View File

@@ -0,0 +1,58 @@
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.Stage
import com.badlogic.gdx.scenes.scene2d.ui.Table
import com.badlogic.gdx.scenes.scene2d.ui.TextButton
import com.badlogic.gdx.scenes.scene2d.ui.Value
import com.badlogic.gdx.scenes.scene2d.utils.TextureRegionDrawable
import ktx.app.KtxScreen
import ktx.app.clearScreen
class MainMenu : KtxScreen {
val stage = Stage()
val table = Table()
var tableWidthPadAmount = 0.8f
var tableHeightPadAmount = 0.8f
//region Buttons
val defaultButtonTrd = TextureRegionDrawable(Texture("default.png"))
val flippedDefaultButtonTrd = TextureRegionDrawable(Texture("default_flipped.png"))
val defaultTextButtonStyle = TextButton.TextButtonStyle (
defaultButtonTrd,
flippedDefaultButtonTrd,
defaultButtonTrd,
BitmapFont()
)
val defaultButton = TextButton("Default Button", defaultTextButtonStyle)
//endregion
override fun show() {
// Stage Setup
Gdx.input.inputProcessor = stage
stage.addActor(table)
// Table Setup
table.debug = true
table.setPosition(
stage.width * ((1 - tableWidthPadAmount) / 2),
stage.height * ((1 - tableHeightPadAmount) / 2)
) // This centres the table
table.setSize(stage.width * tableWidthPadAmount, stage.height * tableHeightPadAmount)
table.add(defaultButton).growX().height(Value.percentWidth(9f / 32f, table)) // We use a FreeTypeFontGenerator to do font sizing maybe?
}
override fun render(delta: Float) {
clearScreen(0f, 0f, 0f)
stage.act(delta)
stage.draw()
}
override fun dispose() {
stage.dispose()
}
}

View File

@@ -1,6 +1,6 @@
package com.iofferyoutea.WitchQueen
class Map(val mapType: MapType) {
val rooms = Array(2) { Array<Room>(2) { Room.new } } // We use an array instead of list i think
val rooms = Array(2) { Array<Room>(2) { Room(mapType) } } // We use an array instead of list i think
}

View File

@@ -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
}