From 30bd8013554738e4d38d793dc40d401cdb742396 Mon Sep 17 00:00:00 2001 From: Armin Benz Date: Fri, 14 Apr 2017 22:58:43 +0200 Subject: [PATCH] =?UTF-8?q?Punkte=20werden=20nun=20gez=C3=A4hlt=20:)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../de/samdev/colorrunner/game/renderer/CRGameRenderer.java | 2 +- core/src/de/samdev/colorrunner/game/world/CRGameWorld.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/core/src/de/samdev/colorrunner/game/renderer/CRGameRenderer.java b/core/src/de/samdev/colorrunner/game/renderer/CRGameRenderer.java index feeb17c..d4f2aa0 100644 --- a/core/src/de/samdev/colorrunner/game/renderer/CRGameRenderer.java +++ b/core/src/de/samdev/colorrunner/game/renderer/CRGameRenderer.java @@ -93,7 +93,7 @@ public class CRGameRenderer extends AbstractGameRenderer { private void renderHud(){ beginHud(); - renderHud("Points:", 10); + renderHud("Points: " + gameworld.scoreMeter, 10); renderHud("Time:", (Gdx.graphics.getWidth() / 2) - 10); if (gameworld.mapprovider instanceof EndlessMapProvider)renderDebug("Procedural Piece: \"" + ((EndlessMapProvider)gameworld.mapprovider).getCurrentSection(gameworld.player.bounds).piece_name + "\""); endHud(); diff --git a/core/src/de/samdev/colorrunner/game/world/CRGameWorld.java b/core/src/de/samdev/colorrunner/game/world/CRGameWorld.java index 55be1e7..5d6edc3 100644 --- a/core/src/de/samdev/colorrunner/game/world/CRGameWorld.java +++ b/core/src/de/samdev/colorrunner/game/world/CRGameWorld.java @@ -25,6 +25,7 @@ public class CRGameWorld implements GameInputListener { public MapProvider mapprovider; private Music music; + public int scoreMeter = 0; public CRGameWorld(MapProvider prov) { @@ -58,6 +59,11 @@ public class CRGameWorld implements GameInputListener { entities.remove(i); } + float posi = player.getPosition().x; + if((posi / 75) >= (float)scoreMeter) + { + scoreMeter++; + } if(player.getPosition().y < - 10) { ((Game) Gdx.app.getApplicationListener()).setScreen(new MainMenu());