summaryrefslogtreecommitdiff
path: root/src/main/kotlin/de/romjaki/pluggabledino/states
diff options
context:
space:
mode:
authorromangraef <romangraef@loves.dicksinhisan.us>2019-01-16 19:24:44 +0100
committerromangraef <romangraef@loves.dicksinhisan.us>2019-01-16 19:24:44 +0100
commitf872cabbe7e4a3eda2aaff9bff8616e62c2d4ff4 (patch)
tree29247c550887479d4d58880908f9ea5b22a85294 /src/main/kotlin/de/romjaki/pluggabledino/states
parente5aca456e5ee2dd4d8c151b86c9de419f7b994c4 (diff)
downloadpluggabledino-f872cabbe7e4a3eda2aaff9bff8616e62c2d4ff4.tar.gz
pluggabledino-f872cabbe7e4a3eda2aaff9bff8616e62c2d4ff4.tar.bz2
pluggabledino-f872cabbe7e4a3eda2aaff9bff8616e62c2d4ff4.zip
Emulator
Signed-off-by: romangraef <romangraef@loves.dicksinhisan.us>
Diffstat (limited to 'src/main/kotlin/de/romjaki/pluggabledino/states')
-rw-r--r--src/main/kotlin/de/romjaki/pluggabledino/states/GameState.kt5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/kotlin/de/romjaki/pluggabledino/states/GameState.kt b/src/main/kotlin/de/romjaki/pluggabledino/states/GameState.kt
index 205446b..db173f2 100644
--- a/src/main/kotlin/de/romjaki/pluggabledino/states/GameState.kt
+++ b/src/main/kotlin/de/romjaki/pluggabledino/states/GameState.kt
@@ -39,7 +39,8 @@ class GameState : BasicGameState() {
Events.broadcastEvent(GameLostEvent(lastscore))
return game.enterState(LOST)
}
- world.update(delta / 1000f, container.input)
+ println(delta)
+ world.update(delta / 1000f, container.input.isKeyDown(Input.KEY_UP))
dinoAnimated.update(delta.toLong())
Events.broadcastEvent(GameUpdateEvent(game, delta, container, world))
}
@@ -58,13 +59,13 @@ class GameState : BasicGameState() {
game!!
g.scale(WIDTH_RATIO, HEIGHT_RATIO)
- g.drawStringCentered((count / 100).toString(), WIDTH / 2f, HEIGHT / 2f)
g.background = Color.white
if (world.hurt) {
g.background = Color.red
}
g.color = Color.green
g.drawImage(background, 0f, 0f)
+ g.drawStringCentered((count / 100).toString(), WIDTH / 2f, HEIGHT / 2f)
g.drawImage(dinoAnimated.currentFrame, world.dino.position.x * WIDTH / 50, world.dino.position.y * HEIGHT / 50 - dinoAnimated.height)
g.drawImage(groundline, 0f, HEIGHT * 39 / 50f)
for (cactus in world.cacti) {