added UI with inventory and some notifications and an end screen + timer
This commit is contained in:
@@ -16,7 +16,7 @@ public class Player extends Entity {
|
||||
|
||||
public final int screenX;
|
||||
public final int screenY;
|
||||
int hasKey = 0;
|
||||
public int hasKey = 0;
|
||||
|
||||
public Player(GamePanel panel, KeyHandler keyH) {
|
||||
this.panel = panel;
|
||||
@@ -98,18 +98,27 @@ public class Player extends Entity {
|
||||
panel.playSE(1);
|
||||
hasKey++;
|
||||
panel.obj[index] = null;
|
||||
panel.ui.showMessage("You got a key!");
|
||||
break;
|
||||
case "door":
|
||||
if(hasKey > 0) {
|
||||
panel.playSE(3);
|
||||
panel.obj[index] = null;
|
||||
hasKey--;
|
||||
panel.ui.showMessage("You opened the door!");
|
||||
}
|
||||
else panel.ui.showMessage("You need a key!");
|
||||
break;
|
||||
case "boots":
|
||||
panel.playSE(2);
|
||||
speed += 1;
|
||||
panel.obj[index] = null;
|
||||
panel.ui.showMessage("Speed up!");
|
||||
break;
|
||||
case "chest":
|
||||
panel.ui.gameFinished = true;
|
||||
panel.stopMusic();
|
||||
panel.playSE(4);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user