Input is data provided to a game via player interaction (through the mouse, keyboard, gamepad, et cetera).

learn more… | top users | synonyms

2
votes
1answer
443 views

How to handle input for both UI and game

So I originally had my input system set up with only the game part in mind. It listens to keyup/down events, marks the key as pressed/unpressed and then when the next update comes around, it sends ...
0
votes
1answer
222 views

Supporting Multiple Input Devices

I'm currently developing a PC game with the assistance of XNA and I'm integrating keyboard and gamepad control support. Up until now I've only supported gamepad control, and finding an elegant way to ...
1
vote
2answers
752 views

Using two joysticks in Cocos2D

Here is what I am trying to do: With the left joystick the player can steer the figure and with the right joystick it can attack. Problem is that the left joystick seems to get all the input, the ...
0
votes
2answers
1k views

Action button: only true once per press

I'm using SFML2.0 and am trying to make a wrapper class for my controller/joystick. I read all the input data from my controller and send it off to my controllable object. I want to have two types of ...
6
votes
2answers
957 views

Observer Pattern Implementation

To teach myself basic game programming, I am going to program a clone of Pong. I will use the Observer design pattern, with an interface between the input and the game engine. However, I'm not sure ...
4
votes
3answers
970 views

Detecting extremely fast joystick button presses?

Is it usually possible for the player to press and release a button within a single frame, so that the game engine doesn't have time to detect it? How do programmers usually handle this situation? ...
1
vote
3answers
1k views

Efficiently checking input and firing events

I'm writing an InputHandler class in XNA, and there are several different keys considered valid input (all of type Microsoft.XNA.Framework.Input.Keys). For each key, I have three events: internal ...
22
votes
2answers
17k views

How to make a character jump?

I am currently making a game in C# using Direct X 9.0. The game remake is Donkey Kong NES. I have nearly everything completed, but I am having problems with the physics of Mario's jump. I have ...
1
vote
2answers
726 views

What is the best way to handle MouseEvents in AS3?

What is the best way to handle MouseEvents? Should I add an event on each MovieClip I want to work with, or a general Event at a holder MovieClip (or even at the stage) with internal control from the ...
-1
votes
1answer
897 views

Windows Events lag behind

I'm making a simple openGL application and so far I can get the window to display, the update/render loop work, and it processes windows events (like WM_QUIT and WM_MOUSE). I've found though that ...
2
votes
1answer
181 views

Game testing using mock input

In this post Patrick Hughes suggested, and michael.bartnett was kind to explain a bit how to do that. While it seems rather clear how to implement and use it, I'm still a bit doubt if this useful ...
1
vote
2answers
311 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.
0
votes
0answers
32 views

Voice Commands Using Microphone [duplicate]

Possible Duplicate: Voice input in games beyond voip chat I recently made a game where you say something into the microphone, and the computer repeats it, but I was wondering how to make ...
9
votes
6answers
6k views

How should I parse user input in a text adventure game?

Parsing user commands in a text adventure is a spectrum from Adventure's simple "go north" to some mind-bogglingly clever ones in hhgttg. I seem to remember reading nice how-tos in computer magazines ...
0
votes
2answers
151 views

How much to bake user input in a client-server?

Assume a client-server game where there server manages all state and the clients are simply rendering / input. How much should I bake user input from the client before sending it off to the server? ...
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
7answers
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()){ ...
1
vote
2answers
714 views

Detecting a click on a tile

I'm making a simple tile-map system in LWJGL, and I'm trying to figure out how to detect if the mouse is clicking inside of a tile. So far no matter where I click it's always the same tile that is ...
3
votes
3answers
877 views

How to refactor and improve this XNA mouse input code?

Currently I have something like this: public bool IsLeftMouseButtonDown() { return currentMouseState.LeftButton == ButtonState.Pressed && previousMouseSate.LeftButton == ...
8
votes
4answers
7k views

Is it possible to detect two different mice at the same time, and have their movements recorded seperately? [closed]

Im thinking of making a game that requires two mice to play. It needs to register the movement separately from one another. Is this possible? Or does the Windows architecture not allow for such ...
3
votes
1answer
2k views

XNA mouse position in windows forms

I am using this code in Update method in XNA RenderControl in Windows Forms: ... Mouse.WindowHandle = renderControl1.Handle; MouseState stat=Mouse.GetState(); ... Everything works fine but when I ...
3
votes
2answers
1k views

How can I map thumbsticks to cardinal directions?

I've got a tile based game that has notions of moving up, down, left, right and the diagonals (by alternating horizontal/vertical movement). I've found that if I use the default ...
3
votes
2answers
614 views

Is this aiming mechanic usable in a third-person top-down game?

Long story short: I've switched to a third person - top down perspective. The camera is fixed and looks down at the player. How can I implement 3d aiming ? The player needs to aim left and right as ...
4
votes
3answers
3k views

How can I stop looking for keyboard input for a length of time?

I'm pretty new to programming, and even newer to C# and XNA. I currently call a method that looks for keyboard input in my Update method. This method has if statements for doing what needs to be done ...
0
votes
1answer
325 views

Delay The Polling Events Of Xbox360 Gamepad With XInput

My team and I are currently developing a 2D platformer with SDL/OpenGL and we want to add support to the Xbox360 Gamepad with the XInput library from Microsoft, but we are currently having a problem. ...
1
vote
2answers
180 views

What is the best way to funnel input to the correct entities?

I have an input pipeline that stores InputObjects into a queue, which I then iterate through once every frame. while(!inputQueue.isEmpty()) { InputObject inp = inputQueue.pop(); boolean ...
1
vote
1answer
144 views

How can I throttle certain player actions?

Background I have a variable time step, component based game, with components that collectively hold an entity's properties and different systems that act on entities with certain required ...
2
votes
1answer
758 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 ...
5
votes
1answer
750 views

A pattern for a contextual InputState in a Game State Management architecture

Context of the question : When developing a game using Game State Management I came across a problematic when it came to handling user input : I want my game to retrieve user input a single way, but ...
2
votes
3answers
1k views

Does VK_SNAPSHOT not send a WM_KEYDOWN; only WM_KEYUP?

On my machine, every key sends a WM_KEYDOWN message except for SysReq/Print Screen key: which only seems to send WM_KEYUP. Is this actually the case?
2
votes
1answer
3k views

SFML - Moving a sprite on mouseclick

I want to be able to move a sprite from a current location to another based upon where the user clicks in the window. This is the code that I have: #include <SFML/Graphics.hpp> int main() { ...
7
votes
3answers
8k views

How do I simulate the mouse and keyboard using C# or C++?

I want to start develop for Kinect, but hardest theme for it - how to send keyboard and mouse input to any application. In previous question I got an advice to develop my own driver for this devices, ...
3
votes
4answers
7k views

How can I process continuously-held keys with SDL?

I have created a cube in opengl using SDL. Now I am trying to move the camera in X direction if user presses left or right arrow keys and Y direction if user presses up or down arrow keys. Right now ...
2
votes
1answer
5k 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 ...
3
votes
2answers
1k views

Is there a universal method to send key or mouse input to any application from C#?

I need method or group of them to send signals to any application (browsers, games, et cetera) about mouse movement or key input. I can easly retrieve an IntPtr to any process, but I don't know what ...
2
votes
2answers
514 views

How do I design a game framework for fast reaction to user input?

I've played some games at cca 30 fps and some of them had low reaction time - cca 0.1sec. I hadn't knew why. Now when I'm designing my framework for crossplatform game, I know why. Probably they've ...
0
votes
2answers
751 views

Ogre3D: customize water demo

On the water demo supplied with Ogre3D's SDK, controls are set to actually control the camera and environment, but not actually the ogre head that generates the disturbances. I tried digging into the ...
6
votes
3answers
2k views

How do I organize my game into multiple classes in C#?

I've made two simple 2D games while following tutorials for the XNA libraries, and I wanted to make something myself, with only the knowledge I gained from these tutorials. This will be my first ...
2
votes
2answers
470 views

How do I handle user input with good class structure/architecture for an Android game?

How do I handle user input having "good" class structure and following normal game architecture*?(see below). At first I didn't think this question was Android specific, although, after seeing a great ...
4
votes
5answers
419 views

Identifying connected lines drawn free-hand by a user

I have a series of 'images' described by a mixture of connected lines and curves. Users will draw on the screen, free hand, and my goal is to break their drawing down into a series of lines and curves ...
10
votes
2answers
599 views

Correct way to abstract an XBox Controller

I've got a XBox360 controller which I'd like to use as input for an application. What I can't work out is the best-practice way to expose this via an interface. Behind the scenes, the class which ...
0
votes
2answers
353 views

how can I move an actor in opposit direction of mouse's position in GameSalad?

I have a moving actor named ball and I want to move it in the opposite direction of my mouse's position. In my code in Move To behaviour for X-axis location I write -game.mouse.position.X and ...
8
votes
1answer
1k views

How does an Input Pipeline work?

I found this article on implementing an input pipeline for Android, but I don't really understand how it works. I also don't completely understand the programming concept of a pipeline or a pool ...
6
votes
6answers
2k views

How do I identify mouse clicks versus mouse down in games?

What is the most common way of handling mouse clicks in games? Given that all you have in way of detecting input from the mouse is whether a button is up or down. I currently just rely on the mouse ...
15
votes
1answer
3k views

Using PS3 controller for input on Mac OSX

I've managed to find a USB driver to connect to the PS3 controller in OSX, and as reported here, can connect to the controller via Bluetooth. I've verified that the input is working properly via ...
1
vote
3answers
623 views

What should I use to handle input? [closed]

What should I use to handle input? I am wanting to use OpenGL so that my games are cross platform. DirectX provides input libraries, and OpenGL does not. Because my games need to be cross platform, I ...
2
votes
3answers
401 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 ...
3
votes
1answer
334 views

How do I use a PC Dance Pad with Xna?

I have a Dance Pad and I want use it in XNA as a controller. It has a USB connection. Can someone help me?
3
votes
2answers
792 views

How do I get consistent Xbox360 Controller input across Linux, Mac, and Windows?

I'm developing a browser plugin to provide joystick access to all browsers on all platforms. The issue that I'm running into is that OS X doesn't seem to provide Xbox 360 joystick input without ...
11
votes
2answers
675 views

In a GUI, should input be handled when the button is pressed or released?

In the menu system for our game (selecting levels, options, etc.), the player presses the a button on the gamepad to go to the next screen. I coded the menu system to wait until the button is released ...