diff options
author | azoooooo <118elemente@gmail.com> | 2018-06-13 17:37:47 +0200 |
---|---|---|
committer | azoooooo <118elemente@gmail.com> | 2018-06-13 17:37:47 +0200 |
commit | bdea42b25e60bfadfd8069d6a3d0b802f00376ee (patch) | |
tree | b43257a9817dc49fa0726d9771bf316499b06211 /src/main/kotlin/de/romjaki/pluggabledino/states/GameState.kt | |
parent | 16e4951fac7f6925f0ea34d9b23ee6c1b56f0355 (diff) | |
download | pluggabledino-bdea42b25e60bfadfd8069d6a3d0b802f00376ee.tar.gz pluggabledino-bdea42b25e60bfadfd8069d6a3d0b802f00376ee.tar.bz2 pluggabledino-bdea42b25e60bfadfd8069d6a3d0b802f00376ee.zip |
score und highscore in loststate
Diffstat (limited to 'src/main/kotlin/de/romjaki/pluggabledino/states/GameState.kt')
-rw-r--r-- | src/main/kotlin/de/romjaki/pluggabledino/states/GameState.kt | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/kotlin/de/romjaki/pluggabledino/states/GameState.kt b/src/main/kotlin/de/romjaki/pluggabledino/states/GameState.kt index 7ac5fa1..7ac2aa9 100644 --- a/src/main/kotlin/de/romjaki/pluggabledino/states/GameState.kt +++ b/src/main/kotlin/de/romjaki/pluggabledino/states/GameState.kt @@ -16,7 +16,7 @@ class GameState : BasicGameState() { override fun enter(container: GameContainer?, game: StateBasedGame?) { world = GameWorld() count = 0 - } +} override fun update(container: GameContainer?, game: StateBasedGame?, delta: Int) { count += delta @@ -24,6 +24,12 @@ class GameState : BasicGameState() { world = GameWorld() } if (world.hurt) { + lastscore = count / 100 + if(lastscore > highscore){ + + highscore = lastscore + + } game!!.enterState(LOST) } world.update(delta / 1000f, container.input) |