added some sample events

This commit is contained in:
2025-11-28 21:52:28 +01:00
parent 4c50f99e67
commit 7616b4daff
5 changed files with 68 additions and 7 deletions

View File

@@ -75,6 +75,11 @@ public class Player extends Entity {
int npcIndex = panel.collisionH.checkEntity(this, panel.npc);
interactNPC(npcIndex);
// CHECK EVENT
panel.eventH.checkEvent();
panel.keyH.spacePressed = false;
if(!collisionOn) {
switch (direction) {
case UP -> worldY -= speed;
@@ -103,7 +108,6 @@ public class Player extends Entity {
//if(!panel.keyH.spacePressed) return; //Only uncomment if text should only appear if player hits space
panel.gameState = GameState.DIALOGUE;
panel.npc[index].speak();
panel.keyH.spacePressed = false;
}
public void draw(Graphics2D graphics2d) {