eat, drop commands

This commit is contained in:
jslightham
2019-05-27 00:03:23 -04:00
parent 58068b94d7
commit 8f8a55949a
4 changed files with 86 additions and 7 deletions

View File

@@ -11,7 +11,7 @@ public class Player extends Entity{
private int currentInventoryWeight;
public Player() {
super();
super(100.0, 100.0);
}
public boolean addToInventory(Item item){
@@ -36,5 +36,17 @@ public class Player extends Entity{
public ArrayList<Item> getInventory() {
return inventory;
}
public void eat() {
// TODO Do we want health or hunger?
health+=5;
hunger+=5;
if(health > 100.0) {
health = 100.0;
}
if(hunger > 100.0) {
hunger = 100.0;
}
}
}