Compare commits
5 Commits
89ff480c2e
...
witch-quee
| Author | SHA256 | Date | |
|---|---|---|---|
| 858971d1db | |||
| 5aba0fc70a | |||
| afe82dbd2a | |||
| 1cc46a94fe | |||
| 4de5a8f88b |
@@ -0,0 +1,4 @@
|
|||||||
|
package com.iofferyoutea.WitchQueen
|
||||||
|
|
||||||
|
class Game(val clients: Array<Client>) {
|
||||||
|
}
|
||||||
@@ -17,8 +17,8 @@ class Main : KtxGame<KtxScreen>() {
|
|||||||
override fun create() {
|
override fun create() {
|
||||||
KtxAsync.initiate()
|
KtxAsync.initiate()
|
||||||
|
|
||||||
addScreen(FirstScreen())
|
addScreen(MainMenu())
|
||||||
setScreen<FirstScreen>()
|
setScreen<MainMenu>()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.iofferyoutea.WitchQueen
|
package com.iofferyoutea.WitchQueen
|
||||||
|
|
||||||
class Map(val mapType: MapType) {
|
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
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,5 +6,5 @@ enum class PlayerState {
|
|||||||
|
|
||||||
class Player(val map: Map) {
|
class Player(val map: Map) {
|
||||||
var currentState = PlayerState.IDLE
|
var currentState = PlayerState.IDLE
|
||||||
val currentRoom
|
val currentRoom = arrayOf(0, 0) // Make this a spawn room or something
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user