summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorromangraef <romangraef@loves.dicksinhisan.us>2019-01-16 19:29:59 +0100
committerromangraef <romangraef@loves.dicksinhisan.us>2019-01-16 19:29:59 +0100
commit11858fa764483e50dc4d2f929da7db1b3e499f9d (patch)
treed3873284e3b30a832085117e7fb862ebab34cef5
parent086d17b7e582eab1fccc31b830fd834a86eef83d (diff)
downloadpluggabledino-11858fa764483e50dc4d2f929da7db1b3e499f9d.tar.gz
pluggabledino-11858fa764483e50dc4d2f929da7db1b3e499f9d.tar.bz2
pluggabledino-11858fa764483e50dc4d2f929da7db1b3e499f9d.zip
settings
-rw-r--r--src/main/kotlin/de/romjaki/pluggabledino/events/InitEvent.kt3
-rw-r--r--src/main/kotlin/de/romjaki/pluggabledino/main.kt5
2 files changed, 5 insertions, 3 deletions
diff --git a/src/main/kotlin/de/romjaki/pluggabledino/events/InitEvent.kt b/src/main/kotlin/de/romjaki/pluggabledino/events/InitEvent.kt
index 1c18682..7fe6e3b 100644
--- a/src/main/kotlin/de/romjaki/pluggabledino/events/InitEvent.kt
+++ b/src/main/kotlin/de/romjaki/pluggabledino/events/InitEvent.kt
@@ -1,6 +1,7 @@
package de.romjaki.pluggabledino.events
import de.romjaki.pluggabledino.api.Event
+import de.romjaki.pluggabledino.states.SettingsState
import org.newdawn.slick.AppGameContainer
-class InitEvent(val app: AppGameContainer) : Event
+class InitEvent(val app: AppGameContainer, val settings: SettingsState) : Event
diff --git a/src/main/kotlin/de/romjaki/pluggabledino/main.kt b/src/main/kotlin/de/romjaki/pluggabledino/main.kt
index 678e7c6..ca9acc0 100644
--- a/src/main/kotlin/de/romjaki/pluggabledino/main.kt
+++ b/src/main/kotlin/de/romjaki/pluggabledino/main.kt
@@ -29,6 +29,7 @@ const val LOST = 4
var lastscore = 0
var highscore = 0
var score = 0
+val settings = SettingsState()
fun main(args: Array<String>) {
if (args.size > 1 && args[0] == "dev") {
@@ -41,7 +42,7 @@ fun main(args: Array<String>) {
app.setTargetFrameRate(FPS)
app.setShowFPS(true)
Events.broadcastEvent(PreInitEvent(app))
- Events.broadcastEvent(InitEvent(app))
+ Events.broadcastEvent(InitEvent(app, settings))
Events.broadcastEvent(PostInitEvent(app))
app.start()
@@ -51,7 +52,7 @@ class Application : StateBasedGame("Dino Game v$VERSION") {
override fun initStatesList(container: GameContainer?) {
addState(SplashScreen())
addState(MainMenu())
- addState(SettingsState())
+ addState(settings)
addState(GameState())
addState(LostState())
}