Skip to content

Commit 68a2f3c

Browse files
committed
Merge branch 'main' of github.com:Java-Game-Maker/JavaGameEngine
2 parents 0690c1c + b4fbac1 commit 68a2f3c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/javagameengine/backend/input/Input.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,22 @@ public static boolean isKeyPressed(int keyCode){
9393
keyDowns.remove(new Integer(keyCode));
9494
return pressed;
9595
}
96+
97+
public static getHorizontal()
98+
{
99+
if(isKeyDown(Keys.D))
100+
return 1
101+
if(isKeyDown(Keys.A))
102+
return -1
103+
}
104+
105+
public static getVertical()
106+
{
107+
if(isKeyDown(Keys.W))
108+
return 1
109+
if(isKeyDown(Keys.S))
110+
return -1
111+
}
96112

97113

98114
}

0 commit comments

Comments
 (0)