diff options
Diffstat (limited to 'src/main/kotlin/de/romjaki/pluggabledino/states/SettingsState.kt')
-rw-r--r-- | src/main/kotlin/de/romjaki/pluggabledino/states/SettingsState.kt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/kotlin/de/romjaki/pluggabledino/states/SettingsState.kt b/src/main/kotlin/de/romjaki/pluggabledino/states/SettingsState.kt index 3e667da..d79837d 100644 --- a/src/main/kotlin/de/romjaki/pluggabledino/states/SettingsState.kt +++ b/src/main/kotlin/de/romjaki/pluggabledino/states/SettingsState.kt @@ -2,6 +2,7 @@ package de.romjaki.pluggabledino.states import de.romjaki.pluggabledino.* import de.romjaki.pluggabledino.api.Button +import de.romjaki.pluggabledino.api.ToggleButton import org.newdawn.slick.Color import org.newdawn.slick.GameContainer import org.newdawn.slick.Graphics @@ -18,16 +19,20 @@ class SettingsState : BasicGameState() { override fun enter(container: GameContainer?, game: StateBasedGame?) { backButton.enter() + scoreButton.enter() } override fun update(container: GameContainer?, game: StateBasedGame?, delta: Int) { container!! + scoreButton.update(container.input) backButton.update(container.input) } override fun getID(): Int = SETTINGS + val scoreButton = ToggleButton(listOf("ON", "OFF"), WIDTH * 3 / 4f, HEIGHT / 8f) + val backButton = Button("BACK", WIDTH / 2f, HEIGHT / 8 * 7f) override fun render(container: GameContainer?, game: StateBasedGame?, g: Graphics?) { @@ -35,6 +40,7 @@ class SettingsState : BasicGameState() { g.scale(WIDTH_RATIO, HEIGHT_RATIO) g.background = Color.lightGray backButton.draw(g) + scoreButton.draw(g) } } |