summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Gräf <roman.graef@gmail.com>2018-08-05 17:51:17 +0000
committerGitHub <noreply@github.com>2018-08-05 17:51:17 +0000
commite5aca456e5ee2dd4d8c151b86c9de419f7b994c4 (patch)
treeea396868c130c76717573ec3ebdd8ec506c39e89
parentf538cad2c4f37d834b6df6b5a8ff20b195994482 (diff)
parentbba3d38c8c50431a3cfa999cc4b492434d8c676a (diff)
downloadpluggabledino-e5aca456e5ee2dd4d8c151b86c9de419f7b994c4.tar.gz
pluggabledino-e5aca456e5ee2dd4d8c151b86c9de419f7b994c4.tar.bz2
pluggabledino-e5aca456e5ee2dd4d8c151b86c9de419f7b994c4.zip
Merge pull request #12 from romangraef/background
background
-rw-r--r--src/main/kotlin/de/romjaki/pluggabledino/assets.kt2
-rw-r--r--src/main/kotlin/de/romjaki/pluggabledino/states/GameState.kt1
-rw-r--r--src/main/resources/images/background.pngbin0 -> 113860 bytes
3 files changed, 3 insertions, 0 deletions
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
--- /dev/null
+++ b/src/main/resources/images/background.png
Binary files differ