Schluessel funktioniert

master
Jonathan Hager 6 years ago
parent a1b28c6ce1
commit cfd567af6a

@ -9,8 +9,6 @@ import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.InputProcessor;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.maps.MapLayers;
import com.badlogic.gdx.maps.MapObjects;
@ -335,7 +333,7 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
System.out.println("Es laedt, es laedt, ich will nicht, dass es laedt, wenn es laedt, muss man immer so lange warten!!!!!");
}
}
/*
for(RectangleMapObject rectangleObject : door.getByType(RectangleMapObject.class)){
Rectangle tempDoor = rectangleObject.getRectangle();
System.out.println("Door array");
@ -344,7 +342,6 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
d.getPlayer().setxPos(x);
}
}
*/
float y = d.getPlayer().getyPos();
d.getPlayer().updateY();
@ -360,7 +357,7 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
System.out.println("Es laedt, es laedt, ich will nicht, dass es laedt, wenn es laedt, muss man immer so lange warten!!!!!");
}
}
/*
for(RectangleMapObject rectangleObject : door.getByType(RectangleMapObject.class)){
Rectangle tempDoor = rectangleObject.getRectangle();
@ -368,7 +365,6 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
d.getPlayer().setyPos(y);
}
}
*/
d.getPlayer().updateDirection();
}
@ -433,6 +429,8 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
if(level < 6){
System.out.println("Nächstes Level, here we go");
d.getPlayer().deleteKey();
d.getPlayer().setMovementY(0f);
d.getPlayer().setMovementX(0f);
gs.startLoadingScreen();

@ -57,8 +57,10 @@ public class Inventory {
public boolean checkKey(){
for(int i = 0; i < items.length; i++){
if(items[i].getId() == 0){
return true;
if(items[i] != null){
if(items[i].getId() == 0){
return true;
}
}
}
return false;
@ -66,9 +68,11 @@ public class Inventory {
public void deleteKey(){
for(int i = 0; i < items.length; i++){
if(items[i].getId() == 0){
items[i] = null;
i = items.length + 1;
if(items[i] != null){
if(items[i].getId() == 0){
items[i] = null;
i = items.length + 1;
}
}
}
}

@ -148,7 +148,7 @@ public class MapGenerator {
collisionLayer.getObjects().remove(right);
RectangleMapObject tempTop = new RectangleMapObject(mapDimensionX*48 - 48, ((mapDimensionY / 2) + 1) * 48, 48, (mapDimensionY / 2) * 48);
RectangleMapObject tempBottom = new RectangleMapObject((mapDimensionX / 2) * 48, 0, 48, (mapDimensionY / 2) * 48);
RectangleMapObject tempBottom = new RectangleMapObject(mapDimensionX*48 - 48, 0, 48, (mapDimensionY / 2) * 48);
collisionLayer.getObjects().add(tempTop);
collisionLayer.getObjects().add(tempBottom);

Loading…
Cancel
Save