Endtrigger wird aufgerufen

This commit is contained in:
Armin Benz 2017-08-02 22:04:56 +02:00
parent 3bafdafc2e
commit bf304ffbe6
3 changed files with 17 additions and 1 deletions

View File

@ -1,5 +1,6 @@
package de.samdev.colorrunner.game.renderer;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Preferences;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
@ -15,6 +16,8 @@ import de.samdev.colorrunner.game.world.entities.MovingEntity;
import de.samdev.colorrunner.game.world.entities.gameentities.floor.FloorTileEntity;
import de.samdev.colorrunner.game.world.map.provider.EndlessMapProvider;
import de.samdev.colorrunner.game.world.map.provider.StaticMapProvider;
import de.samdev.colorrunner.screens.gameScreen.GameScreen;
import de.samdev.colorrunner.screens.menu.MainMenu;
public class CRGameRenderer extends AbstractGameRenderer {
private CRGameWorld gameworld;
@ -94,6 +97,13 @@ public class CRGameRenderer extends AbstractGameRenderer {
shapeRenderer.rect(x*ftw+8, y*ftw+8, ftw-16, ftw-16);
shapeRenderer.rect(x*ftw+12, y*ftw+12, ftw-24, ftw-24);
break;
case END:
shapeRenderer.setColor(0, 1, 1, 1f);
shapeRenderer.rect(x*ftw+0, y*ftw+0, ftw-0, ftw-0);
shapeRenderer.rect(x*ftw+4, y*ftw+4, ftw-8, ftw-8);
shapeRenderer.rect(x*ftw+8, y*ftw+8, ftw-16, ftw-16);
shapeRenderer.rect(x*ftw+12, y*ftw+12, ftw-24, ftw-24);
break;
case NOTHING:
break;
}

View File

@ -30,7 +30,7 @@ public class CRGameWorld implements GameInputListener {
public Rectangle camViewBoundaries = new Rectangle();
public MapProvider mapprovider;
private Music music;
public Music music;
public int scoreMeter = 0;
public CRGameWorld(MapProvider prov) {

View File

@ -1,5 +1,6 @@
package de.samdev.colorrunner.game.world.entities.gameentities;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Texture;
@ -15,6 +16,7 @@ import de.samdev.colorrunner.game.world.entities.gameentities.controller.FlyPlay
import de.samdev.colorrunner.game.world.entities.gameentities.controller.RunTopPlayerController;
import de.samdev.colorrunner.game.world.entities.gameentities.floor.FloorTileEntity;
import de.samdev.colorrunner.game.world.map.provider.TriggerType;
import de.samdev.colorrunner.screens.menu.MainMenu;
public class PlayerEntity extends MovingEntity {
public final static float PLAYER_WIDTH = 31.9f;
@ -56,6 +58,10 @@ public class PlayerEntity extends MovingEntity {
case GRAVITY:
if (controller.getControllerType() != ControllingType.GRAVITY) controller = new GravityPlayerController(this);
break;
case END:
((Game)Gdx.app.getApplicationListener()).setScreen(new MainMenu());
world.music.stop();
break;
}
controller.update(delta);