Skip to content

Commit b83e4d7

Browse files
committed
update
1 parent b7cb605 commit b83e4d7

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

.idea/artifacts/JavaGameEngine_jar2.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
161 Bytes
Binary file not shown.

src/JavaGameEngine/Backend/GameWorld.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package JavaGameEngine.Backend;
22

33
import JavaGameEngine.Backend.Input.Input;
4+
import JavaGameEngine.Backend.Input.Keys;
45
import JavaGameEngine.Components.Component;
56
import JavaGameEngine.Components.GameObject;
67
import JavaGameEngine.Components.Ui.UiComponent;
@@ -30,6 +31,9 @@ public GameWorld() {
3031
@Override
3132
public void keyPressed(KeyEvent e) {
3233
super.keyPressed(e);
34+
if(e.getKeyCode()== Keys.ESCAPE){
35+
UpdateThread.running = !UpdateThread.running;
36+
}
3337
Input.addKey(e);
3438
}
3539
@Override
@@ -79,6 +83,7 @@ public void mouseMoved(MouseEvent e) {
7983
@Override
8084
protected void paintComponent(Graphics g) {
8185
super.paintComponent(g);
86+
8287
drawComponents(g);
8388
}
8489
private void drawUi(Graphics g){

src/JavaGameEngine/Backend/Input/Keys.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ public class Keys {
1010
public static final int LEFTARROW = 37;
1111
public static final int RIGHTARROW = 40;
1212
public static final int SPACE = 32;
13-
public static final int RIGHTCLICK = 1;
14-
public static final int LEFTCLICK = 3;
13+
public static final int SHIFT = 16;
14+
public static final int ESCAPE = 27;
15+
16+
public static final int LEFTCLICK = 1;
17+
public static final int RIGHTCLICK = 3;
1518
public static final int MIDDLECLICK = 2;
1619

20+
1721
}

0 commit comments

Comments
 (0)