From bba3d38c8c50431a3cfa999cc4b492434d8c676a Mon Sep 17 00:00:00 2001 From: romangraef Date: Sun, 5 Aug 2018 19:50:15 +0200 Subject: background --- src/main/kotlin/de/romjaki/pluggabledino/assets.kt | 2 ++ .../de/romjaki/pluggabledino/states/GameState.kt | 1 + src/main/resources/images/background.png | Bin 0 -> 113860 bytes 3 files changed, 3 insertions(+) create mode 100644 src/main/resources/images/background.png diff --git a/src/main/kotlin/de/romjaki/pluggabledino/assets.kt b/src/main/kotlin/de/romjaki/pluggabledino/assets.kt index 5c12b35..dc5b9d0 100644 --- a/src/main/kotlin/de/romjaki/pluggabledino/assets.kt +++ b/src/main/kotlin/de/romjaki/pluggabledino/assets.kt @@ -27,3 +27,5 @@ val cactusImg = Image(TextureLoader.getTexture("PNG", FileInputStream("assets/im val BirdImg = Image(TextureLoader.getTexture("PNG", FileInputStream("assets/images/bird1.png"))) val anthemSound = Music(FileInputStream("assets/audio/anthem.ogg"), "anthem.ogg") + +val background = Image(TextureLoader.getTexture("PNG", FileInputStream("assets/images/background.png"))) diff --git a/src/main/kotlin/de/romjaki/pluggabledino/states/GameState.kt b/src/main/kotlin/de/romjaki/pluggabledino/states/GameState.kt index fd868a9..205446b 100644 --- a/src/main/kotlin/de/romjaki/pluggabledino/states/GameState.kt +++ b/src/main/kotlin/de/romjaki/pluggabledino/states/GameState.kt @@ -64,6 +64,7 @@ class GameState : BasicGameState() { g.background = Color.red } g.color = Color.green + g.drawImage(background, 0f, 0f) 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) { diff --git a/src/main/resources/images/background.png b/src/main/resources/images/background.png new file mode 100644 index 0000000..902e3c0 Binary files /dev/null and b/src/main/resources/images/background.png differ -- cgit