master
GammelJAN 6 years ago
parent b58be7a018
commit 6c5816218d

@ -585,13 +585,12 @@ public class Controller extends ApplicationAdapter implements InputProcessor{
if(keycode == Input.Keys.F){ if(keycode == Input.Keys.F){
if(mm != null){} if(mm != null){}
if(gs != null && gs.getIsLoading() == false){ if(gs != null && gs.getIsLoading() == false){
//Item k = new Sword(1); if(!d.getPlayer().inventoryFull()){
//m.addItem(k); ArrayList<ItemContainer> garbage = playerPickUp();
//d.setCurrentItemContainer(m.playerPickUp(d.getCurrentItemContainer(), d.getPlayer()));
ArrayList<ItemContainer> garbage = playerPickUp(); for(ItemContainer item : garbage){
d.getPlayer().getInv().addItem(item.getItem());
for(ItemContainer item : garbage){ }
d.getPlayer().getInv().addItem(item.getItem());
} }
} }
} }

@ -53,6 +53,16 @@ public class Inventory {
} }
} }
public boolean inventoryFull(){
for(int i = 2; i<items.length; i++){
if(items[i] == null){
return false;
}
}
return true;
}
public void setItem(int x, Item i){ public void setItem(int x, Item i){
items[x] = i; items[x] = i;
} }

@ -133,5 +133,8 @@ public class Player extends Entity {
public int getSkin(){ public int getSkin(){
return skin; return skin;
} }
public boolean inventoryFull(){
return inv.inventoryFull();
}
} }

@ -62,12 +62,15 @@ public class EntitySprite implements Comparable<EntitySprite> {
updateDie(); updateDie();
} }
else if(attackState == 1){ else if(attackState == 1){
updateFlip();
updateAttack(); updateAttack();
} }
else if(secondaryAttackState == 1){ else if(secondaryAttackState == 1){
updateFlip();
updateSecondaryAttack(); updateSecondaryAttack();
} }
else if(moves){ else if(moves){
updateFlip();
updateWalking(); updateWalking();
} }
else{ else{
@ -99,6 +102,7 @@ public class EntitySprite implements Comparable<EntitySprite> {
if(frames[2] >= 6){ if(frames[2] >= 6){
frames[2] = 0; frames[2] = 0;
attackState = 2; attackState = 2;
updateFlip();
} }
else{ else{
frames[2]++; frames[2]++;

Loading…
Cancel
Save