master
GammelJan 6 years ago
parent 4891d9ad78
commit 05c123efd0

Binary file not shown.

After

Width:  |  Height:  |  Size: 770 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 813 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 729 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

@ -61,7 +61,7 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
volume = 0.01f;
arrows = new Entity[10];
roomX = 10;
roomX = 13;
roomY = 6;
batch = new SpriteBatch();
@ -313,14 +313,12 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
d.setCurrentEntities(m.playerAttack(d.getCurrentEntities(), d.getPlayer(), batch));
}
}
/*
if(keycode == Input.Keys.F){
/*if(keycode == Input.Keys.F){
if(v != null){}
if(m != null){
d.setCurrentItemContainer(m.playerPickUp(d.getCurrentItemContainer(), d.getPlayer()));
}
}
*/
}*/
if(keycode == Input.Keys.UP){
volume += 0.1f;
@ -414,6 +412,7 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
}
if(m != null){
return true;
}
}

@ -15,6 +15,7 @@ public abstract class Entity {
protected float movementY;
protected int id;
protected int facing;
protected Inventory inv;

@ -6,14 +6,13 @@ public class Inventory {
Item items[][];
Item equipped[];
Inventory(int width, int height){
public Inventory(int width, int height){
items = new Item[width][height];
equipped = new Item[2];
}
public void addItem(Item i)
{
for(int n = 0; n <= items.length; n++){
for(int m = 0; m <= items[0].length; m++){
if(items[n][m] == null){

@ -7,6 +7,8 @@ package com.dungeoncrawler.model.entities;
import com.dungeoncrawler.model.Entity;
import com.dungeoncrawler.model.Inventory;
import com.dungeoncrawler.model.Item;
import com.dungeoncrawler.model.ItemContainer;
/**
*
@ -22,11 +24,12 @@ public class Player extends Entity {
this.dmg = 3*lvl;
id = -1;
inv = new Inventory(3,2);
// TODO: Sinnvolle Werte finden
}
public void pickUp(ItemContainer items){
public void pickUp(Item item){
inv.addItem(item);
}
}

@ -90,7 +90,7 @@ public class GameScreen {
camera = new OrthographicCamera(1, h/w);
camera.translate(300f, 200f);
MapGenerator mg = new MapGenerator(new Texture(Gdx.files.internal("tilesets/tileset_floor_1.png")));
MapGenerator mg = new MapGenerator(new Texture(Gdx.files.internal("tilesets/haha.png")));
m = mg.generateMap(d);
mg.ichWillSpielen(m.getMaps());
@ -346,11 +346,13 @@ public class GameScreen {
/*
public ItemContainer playerPickUp(ItemContainer[] items, Player p){
for(int i = 0; i < items.length; i++){
if(Intersector.overlaps(player.getBoundingRectangle(), itemSprite[i].getBoundingRectangle())){
player.pickUp(items[i].getItem());
items[i] = null;
if(items[i] != null){
if(Intersector.overlaps(player.getBoundingRectangle(), itemSprite[i].getBoundingRectangle())){
player.pickUp(items[i].getItem());
items[i] = null;
}
}
}
return items;

@ -63,7 +63,7 @@ public class MapGenerator {
Room room = l.getRooms()[x][y];
if(room != null){
int tempX = 9;
int tempX = 12;
int tempY = 5;
int mapDimensionX = tempX + 2;

Loading…
Cancel
Save