master
GammelJan 6 years ago
parent 1f6fd57d8c
commit 3109e1916d

@ -36,11 +36,11 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
MainMenuScreen mm; MainMenuScreen mm;
GameScreen gs; GameScreen gs;
HudContainer hc; HudContainer hc;
PauseScreen ps; PauseScreen ps;
SettingsScreen ss; SettingsScreen ss;
ControlsScreen cs; ControlsScreen cs;
EndScreen es;
// //
int tileX; int tileX;
@ -274,6 +274,9 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
if(ps != null){ if(ps != null){
ps.render(batch, volume); ps.render(batch, volume);
} }
if(es != null){
es.render(batch, volume);
}
//PASSIERT IN GAMESCREEN //PASSIERT IN GAMESCREEN
if(gs != null && mm == null && isPaused == false){ if(gs != null && mm == null && isPaused == false){
@ -438,8 +441,9 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
roomPosX = roomAmount / 2; roomPosX = roomAmount / 2;
roomPosY = roomAmount / 2; roomPosY = roomAmount / 2;
} }
else if (level >= 6){ else{ // Dungeon Exit
es = new EndScreen();
gs = null;
} }
} }
@ -795,6 +799,9 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
gs.music.setVolume(volume); gs.music.setVolume(volume);
} }
return true; return true;
case 11:
create();
break;
} }
if(gs != null && gs.getIsLoading() == false){ if(gs != null && gs.getIsLoading() == false){

@ -32,7 +32,7 @@ public abstract class Entity {
} }
public boolean attack(Entity e){ public boolean attack(Entity e){
if(e.getHp() - this.dmg < 0){ if(e.getHp() - this.dmg <= 0){
e.setHp(1); e.setHp(1);
return true; return true;
} }

@ -10,9 +10,7 @@ public class Inventory {
int width; int width;
int height; int height;
public Inventory(int width, int height){ public Inventory(){
this.width = width;
this.height = height;
items = new Item[8]; items = new Item[8];
selected = 2; selected = 2;
} }

@ -29,16 +29,16 @@ public class Player extends Entity {
this.standartDmg = dmg; this.standartDmg = dmg;
id = -1; id = -1;
type = -1; type = -1;
inv = new Inventory(3,2); inv = new Inventory();
// TODO: Sinnvolle Werte finden // TODO: Sinnvolle Werte finden
this.targetsPlayer = false; this.targetsPlayer = false;
} }
public void updateStats(int lvl){ public void updateStats(int ey){
this.lvl = lvl; lvl = ey;
this.standartMaxHp = 100 * lvl; standartMaxHp = 100 * ey;
this.standartDmg = 100 * lvl; standartDmg = 100 * ey;
updateItems(); updateItems();
} }

@ -7,6 +7,7 @@ package com.dungeoncrawler.view;
import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.graphics.g2d.TextureRegion;
@ -19,7 +20,14 @@ import com.badlogic.gdx.math.Rectangle;
*/ */
public class EndScreen { public class EndScreen {
Sprite backButton;
public EndScreen(){
backButton = new Sprite(new Texture("sprites/backButton.png"));
backButton.setPosition(100, 100);
}
public void render (SpriteBatch batch, float volume) { public void render (SpriteBatch batch, float volume) {
Gdx.gl.glClearColor(0, 0, 0, 1); Gdx.gl.glClearColor(0, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
@ -30,10 +38,10 @@ public class EndScreen {
public int click(int x, int y){ // prueft ob cursor mit button (START) ueberlappt public int click(int x, int y){ // prueft ob cursor mit button (START) ueberlappt
Rectangle r = new Rectangle(x,y,1,1);
//if(Intersector.overlaps(r, backButtonSprite.getBoundingRectangle())){ if(Intersector.overlaps(r, backButton.getBoundingRectangle())){
// return 5; //proceed Game return 11; //NEUSTART
//} }
return -1; return -1;

Loading…
Cancel
Save