open NPC dialogue if you collide with it
This commit is contained in:
@@ -2,10 +2,10 @@ package de.miaurizius.jgame2d.entity;
|
||||
|
||||
import de.miaurizius.jgame2d.core.*;
|
||||
import de.miaurizius.jgame2d.core.enums.Direction;
|
||||
import de.miaurizius.jgame2d.core.enums.GameState;
|
||||
import de.miaurizius.jgame2d.core.handlers.KeyHandler;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
public class Player extends Entity {
|
||||
|
||||
@@ -91,12 +91,12 @@ public class Player extends Entity {
|
||||
|
||||
public void pickObject(int index) {
|
||||
if(index == 999) return;
|
||||
|
||||
}
|
||||
|
||||
public void interactNPC(int index) {
|
||||
if(index == 999) return;
|
||||
System.out.println("npc collision detected");
|
||||
panel.gameState = GameState.DIALOGUE;
|
||||
panel.npc[index].speak();
|
||||
}
|
||||
|
||||
public void draw(Graphics2D graphics2d) {
|
||||
|
||||
Reference in New Issue
Block a user