add lantern object and implement light management in player and environment
This commit is contained in:
@@ -20,6 +20,7 @@ public class Player extends Entity {
|
||||
|
||||
// STATE
|
||||
public boolean attackCancel;
|
||||
public boolean lightUpdated;
|
||||
|
||||
public Player(GamePanel panel, KeyHandler keyH) {
|
||||
super(panel);
|
||||
@@ -289,6 +290,10 @@ public class Player extends Entity {
|
||||
currentShield = selectedItem;
|
||||
getDefense();
|
||||
}
|
||||
if(selectedItem.type == EntityType.LIGHT) {
|
||||
if(currentLight == selectedItem) currentLight = null; else currentLight = selectedItem;
|
||||
lightUpdated = true;
|
||||
}
|
||||
if(selectedItem.consumable)
|
||||
if(selectedItem.use(this))
|
||||
if(selectedItem.amt > 1) selectedItem.amt--; else inventory.remove(selectedItem);
|
||||
|
||||
Reference in New Issue
Block a user