diff options
author | Tyrannova <daniel.sluga@grb-online.net> | 2019-01-17 22:47:45 +0100 |
---|---|---|
committer | Tyrannova <daniel.sluga@grb-online.net> | 2019-01-17 22:47:45 +0100 |
commit | b90e6a47911902cee91cbda1ccb2f184cbcb1a21 (patch) | |
tree | b089d5335598af2209042bfbe2424650c2d23652 /src/main | |
parent | 11858fa764483e50dc4d2f929da7db1b3e499f9d (diff) | |
download | pluggabledino-b90e6a47911902cee91cbda1ccb2f184cbcb1a21.tar.gz pluggabledino-b90e6a47911902cee91cbda1ccb2f184cbcb1a21.tar.bz2 pluggabledino-b90e6a47911902cee91cbda1ccb2f184cbcb1a21.zip |
settings v2
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/kotlin/de/romjaki/pluggabledino/main.kt | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main/kotlin/de/romjaki/pluggabledino/main.kt b/src/main/kotlin/de/romjaki/pluggabledino/main.kt index ca9acc0..0af8a64 100644 --- a/src/main/kotlin/de/romjaki/pluggabledino/main.kt +++ b/src/main/kotlin/de/romjaki/pluggabledino/main.kt @@ -29,8 +29,9 @@ const val LOST = 4 var lastscore = 0 var highscore = 0 var score = 0 -val settings = SettingsState() +var eventThreads: MutableList<Thread> = mutableListOf() +lateinit var settings: SettingsState fun main(args: Array<String>) { if (args.size > 1 && args[0] == "dev") { PluginLoader.loadDevPlugin(args[1]) @@ -42,8 +43,10 @@ fun main(args: Array<String>) { app.setTargetFrameRate(FPS) app.setShowFPS(true) Events.broadcastEvent(PreInitEvent(app)) - Events.broadcastEvent(InitEvent(app, settings)) - Events.broadcastEvent(PostInitEvent(app)) + eventThreads.add(Thread { + Events.broadcastEvent(InitEvent(app, settings)) + Events.broadcastEvent(PostInitEvent(app)) + }) app.start() } @@ -52,8 +55,10 @@ class Application : StateBasedGame("Dino Game v$VERSION") { override fun initStatesList(container: GameContainer?) { addState(SplashScreen()) addState(MainMenu()) + settings = SettingsState() addState(settings) addState(GameState()) addState(LostState()) + eventThreads.forEach(Thread::start) } } |