0
votes
2answers
87 views

Smooth input handling in Java [closed]

I am writing a Java game. My problem is to get a really smooth input. If I hit the key W the character has to go forwards, but if I hit A and release the W key, the character doesn't go left ways :( ...
0
votes
1answer
77 views

LWJGL - Keyboard.next() not firing

I am trying to make a class which will handle all of my inputs, however Keyboard.next() isn't returning true. Here is my code. while(Keyboard.next()) { if(Keyboard.getEventKey() == ...
1
vote
1answer
57 views

How can I check for key releases between keyReleased callbacks?

Slick2D's Input class has a isKeyPressed() method that returns a boolean value according to whether the specified key has been pressed. I want to check if a key has been released in the same fashion. ...
1
vote
1answer
457 views

Handling XBox 360 Controller Connections in LibGDX after Game has Started

I am currently making a game with the java library LibGDX and want to add XBox 360 controller support using the GDX-Controllers extension. At the moment I have a setup where I create a listener to ...
0
votes
1answer
168 views

LWJGL: Camera distance from image plane?

Let me paste some code before I ask the question... public static void createWindow(int[] args) { try { Display.setFullscreen(false); DisplayMode d[] = ...
1
vote
0answers
73 views

The input doesn't recognize that I release the key? [closed]

I'm creating a window (JOptionPane), in response to a collision. However, if the player is holding a key down when the window pops up, the input doesn't trigger a key release when the key is released. ...
1
vote
1answer
69 views

All libGDX input statements are returning TRUE at once

I'm fooling around with Box2D and libGDX and running into a peculiar problem with polling for input. Here's the code for the Screen's render() loop: @Override public void render(float delta) { ...
1
vote
1answer
218 views

LWJGL Wait for key press in a single method

Currently I am implementing the possibility in my game to change the keyboard configuration. Therefor, I have a menu in which is a button for each action the player can do. If the player clicks on one ...
0
votes
1answer
268 views

Design question: How to handle input more efficiently?

I'm designing a system to handle the keyboard input for my game. To get it more simple, I have a class that has two methods, KeyUp and KeyDown which tell me which key has been pressed, this is already ...
-1
votes
1answer
950 views

How can I support PS3 controllers in my Java game?

Is there a lightweight open source library that would allow me to get PS3 controller input and use it in a program (for OS X and Windows) that I am writing in Java? The alternatives I were looking at ...
0
votes
1answer
985 views

libgdx keyboard input

I'm trying to figure it out how to check if keyboard key was released. I tried messing around with InputMultiplexer, InputProcessor, etc. Nothing helped. Not enough documentation from lib developers ...
1
vote
1answer
180 views

LibGdx: How do I combine 2 GestureListener objects from 2 seperate classes into 1 GestureDetector

I'm trying to make 2 separate classes, 1 a VirtualJoystick class and 1 a VirtualButton class. I want to implement a GestureListener class in each, it just seems like good code to do so, but when I go ...
0
votes
0answers
230 views

fire multiple events in InputListener

I have two Actors on my stage in libgdx and and both have a InputListener. I override the touchDown method and it works fine. My Problem is that when I press my Actor Z and a second later Actor Y only ...
1
vote
2answers
869 views

How to I rotate a triangle by dragging the mouse in libGDX?

More specifically, I have rotation working in a way I don't like as follows: //Draw the triangle using this draw method //batch.draw(texture, x, y, ...
0
votes
1answer
117 views

Merging InputProcessor and GestureDetector

I'm planning to make a simple soccerball app. When I attempt to drag the ball, I use the touchDragged() from InputProcessor to move the ball left or right. Next, while holding before releasing, I use ...
-2
votes
1answer
123 views

Java Translate Key Input [closed]

I decided to randomly start a small OpenGL 2D game, and the problem is, my keyboard input isn't working. There are no errors or anything, however, the little square I've created refuses to move. ...
0
votes
2answers
200 views

Java applet game design no keyboard focus

THIS IS PROBABLY THE WRONG PLACE. POSTED ITHERE (STACKOVERFLOW) I'm making an applet game and it is rendering, the game loop is running, the animations are updating, but the keyboard input is not ...
1
vote
2answers
231 views

What is a library for event-driven mouse and keyboard input in Java?

The title basically says it all. The only thing to take into consideration is it needs to be cross platform.
4
votes
1answer
3k views

libGDX Multitouch Controls

Has anyone had any trouble implementing multitouch on-screen controls in libGDX, such as multiple joysticks? I've tried and I can't seem to get libGDX to play nice with multitouch/multiple pointers on ...
2
votes
5answers
2k views

Implementing pausing functionality

I'm working in LWJGL and trying to implement pausing when the user presses the 'P' key. Thus far I have this: boolean gamePaused = false; while(!Display.isCloseRequested()){ ...
2
votes
1answer
701 views

How to move a 2d sprite to a target location while avoiding obstacles?

How can I get a 2d sprite to move to a position clicked on the screen, without bumping into other objects? I'm programming in java using the android API library I have created a surface view and ...
2
votes
1answer
4k views

How move sprite in Java 2d (swing) with keyboard?

I'm practicing some simple techniques with Java swing games, to learn the basics. Right now I'm practicing how to move a sprite... but it's not working! whhyyyy Here is what I've come up with so far ...
2
votes
3answers
385 views

Efficient way of detecting a touched object in a game?

Imagine a Sims-like 2D game for a touch based mobile phone where one can interact with virtually any object in the scene. How can I efficiently detect which object is being touched by the player? In ...
17
votes
3answers
4k views

Polling vs event driven input

I'm developing a game using polling for the input method. However, now that I'm delving deeper into the game menus and other UI components, I'm finding that I'd probably like to have event driven ...
7
votes
2answers
785 views

How should i have the key/mouse input in an advanced java game?

I am a self taught programmer, so I do not know the proper ways to do things. I have made simple games like asteroids and snake, but in those games, you can easily modify the variables within the ...
2
votes
3answers
4k views

Understanding MotionEvent to implement a virtual DPad and Buttons on Android (Multitouch)

I'm trying to implement a virtual DPad in android, but I'm still very confused about how do I keep track of each trouch point, from the moment it is pressed, till it is released. In my code, I test ...