Tagged Questions
1
vote
1answer
44 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
64 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 ...
0
votes
2answers
124 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
54 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 ...
0
votes
0answers
127 views
LWJGL Mouse Input [closed]
I have this mouse function in my LWJGL program:
public void mouseInput(){
int mouseX = Mouse.getX();
int mouseY = 600 - Mouse.getY();
int mouseDX = 0, mouseDY = 0;
int lastX = 0, ...
-2
votes
1answer
66 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
130 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
122 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
2k 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
4answers
640 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
564 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
2k 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
354 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 ...
14
votes
3answers
2k 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
508 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
3k 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 ...