Skip to content

Commit b4fbac1

Browse files
authored
Merge pull request #39 from SharkooMaster/patch-2
preset inputs, just an idea, look around how to make it work
2 parents 07fcd37 + b8a0322 commit b4fbac1

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
@@ -85,6 +85,22 @@ public static boolean isKeyPressed(int keyCode){
8585
keyDowns.remove(new Integer(keyCode));
8686
return pressed;
8787
}
88+
89+
public static getHorizontal()
90+
{
91+
if(isKeyDown(Keys.D))
92+
return 1
93+
if(isKeyDown(Keys.A))
94+
return -1
95+
}
96+
97+
public static getVertical()
98+
{
99+
if(isKeyDown(Keys.W))
100+
return 1
101+
if(isKeyDown(Keys.S))
102+
return -1
103+
}
88104

89105

90106
}

0 commit comments

Comments
 (0)