diff --git a/cicaprojekt/ApplicationFrame.java b/cicaprojekt/ApplicationFrame.java index 7858ff3..d70b58f 100644 --- a/cicaprojekt/ApplicationFrame.java +++ b/cicaprojekt/ApplicationFrame.java @@ -36,6 +36,7 @@ public class ApplicationFrame implements Runnable public void init(){ jframe = new JFrame(); + jframe.setFocusable(true); jframe.setMinimumSize(new Dimension(600, 400)); jframe.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); @@ -71,9 +72,9 @@ public class ApplicationFrame implements Runnable private void setGameParams(File dungeonFile) throws IOException { gamepanel = new Display(); + jframe.addKeyListener(new Control.KeyHandler()); Game.instance.setDisplay(gamepanel); Game.instance.setDungeon(new Dungeon()); Game.instance.startGame(dungeonFile); - } }