master
GammelJan 6 years ago
parent 1f6fd57d8c
commit 3109e1916d

@ -36,11 +36,11 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
MainMenuScreen mm;
GameScreen gs;
HudContainer hc;
PauseScreen ps;
SettingsScreen ss;
ControlsScreen cs;
EndScreen es;
//
int tileX;
@ -274,6 +274,9 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
if(ps != null){
ps.render(batch, volume);
}
if(es != null){
es.render(batch, volume);
}
//PASSIERT IN GAMESCREEN
if(gs != null && mm == null && isPaused == false){
@ -438,8 +441,9 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
roomPosX = 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);
}
return true;
case 11:
create();
break;
}
if(gs != null && gs.getIsLoading() == false){

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

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

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

@ -7,6 +7,7 @@ package com.dungeoncrawler.view;
import com.badlogic.gdx.Gdx;
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.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
@ -19,7 +20,14 @@ import com.badlogic.gdx.math.Rectangle;
*/
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) {
Gdx.gl.glClearColor(0, 0, 0, 1);
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
//if(Intersector.overlaps(r, backButtonSprite.getBoundingRectangle())){
// return 5; //proceed Game
//}
Rectangle r = new Rectangle(x,y,1,1);
if(Intersector.overlaps(r, backButton.getBoundingRectangle())){
return 11; //NEUSTART
}
return -1;

Loading…
Cancel
Save