summaryrefslogtreecommitdiff
path: root/src/main/kotlin/de/romjaki/pluggabledino
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/de/romjaki/pluggabledino')
-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())
}