Punkte werden nun gezählt :)

This commit is contained in:
Armin Benz 2017-04-14 22:58:43 +02:00
parent 87e95ba645
commit 30bd801355
2 changed files with 7 additions and 1 deletions

View File

@ -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();

View File

@ -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());