Interaction from the player that corresponds to action in the game. Or in simpler terms - pushing buttons!
50
votes
5answers
14k views
Good 2D Platformer Physics
I have a basic character controller set up for a 2D platformer with Box2D, and I'm starting to tweak it to try to make it feel good. Physics engines have a lot of knobs to tweak, and it's not clear to ...
18
votes
3answers
587 views
Do I, and how, separate the concerns of input and game objects?
In probably every game a developer has to somehow deal with input, may it be simple keyboard and mouse events, touch events or something as accelerometer input. This input directly of indirectly ...
16
votes
2answers
3k 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 ...
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 ...
11
votes
6answers
4k views
Making (or emulating) a “D-Pad” on a touch-screen; virtual d-pad
With the proliferation of touch based devices, many lacking a true D-Pad, I'm wondering if anyone has any resources on how to emulate a D-Pad on a touch screen? I'm specifically interested in XNA ...
11
votes
3answers
571 views
Why is forward=down mouse orientation commonly called “inverted”?
If you look at 3D games that allow you to control the camera using the mouse--most notably first-person and third-person shooter style games--you'll usually find two specific details:
By default, ...
11
votes
1answer
1k 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 ...
10
votes
6answers
11k views
How to handle mouse input in XNA?
I am developing a card game in XNA.
Is there any OnClick event in XNA for objects?
I am trying to make cards move when the player clicks on them. In this project, there is a Sprite class that draws ...
10
votes
5answers
2k views
Keyboard input system handling
Note: I have to poll, rather than do callbacks because of API limitations (SFML). I also apologize for the lack of a 'decent' title.
I think I have two questions here; how to register the input I'm ...
10
votes
5answers
291 views
What is a suitable input method to use for a 2D platformer on a touch device?
I am creating a 2d platformer game like Super Meat Boy in which precision of movement of my lead character matters. I am using libgdx. The keyboard controls on the PC work precisely, but when it comes ...
9
votes
2answers
540 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 ...
9
votes
1answer
362 views
Is there a gold standard for touch controls in scrolling shoot-em-ups?
Is there currently a "standard" for touch controls in shooters on platforms such as iPhone or Android? I've noticed that many of them enable auto-fire by default, or control the character via direct ...
8
votes
2answers
379 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 ...
8
votes
5answers
702 views
Nested input in an event-driven system
I am using an event-based input handling system with events and delegates. An example:
InputHander.AddEvent(Keys.LeftArrow, player.MoveLeft); //Very simplified code
However, I started wondering ...
8
votes
5answers
4k views
Handling keyboard and mouse input (Win API)
There is a number of ways to catch mouse or keyboard under Windows. So I tried some of them, but every of them has some advantages and drawbacks. I want to ask you: Which method do use?
I've tried ...
8
votes
3answers
746 views
Key combinations on poll-based input
So assume you have an input system that is based on polling
void update()
{
if( Keyboard[ 'A' ] )
// A is down
}
Say you want to be able to recognize 3 to 8 length key combinations ...
8
votes
3answers
378 views
How does one separate the acceleration due to gravity from other motion in accelerometer input?
How does one separate the acceleration due to gravity from other motion in accelerometer input?
8
votes
5answers
1k views
How to get elapsed time of keypress?
I need to be able to determine how long a key has been held down with high accuracy. For example if they key tapped really fast it could report a time that is less than the time for each update frame.
...
8
votes
2answers
953 views
Game state and input handling in component-based entity systems
My question is:
How can I handle game states in my entity system, without resorting to keeping a stack of game state objects around?
So the design of my entity system means that when an entity needs ...
8
votes
1answer
848 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 ...
7
votes
2answers
519 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 ...
7
votes
3answers
2k views
Is it possible to detect two different mice at the same time, and have their movements recorded seperately?
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 ...
6
votes
3answers
1k 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 ...
6
votes
2answers
450 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 ...
6
votes
2answers
2k views
How are components properly instantiated and used in XNA 4.0?
I am creating a simple input component to hold on to actions and key states, and a short history of the last ten or so states. The idea is that everything that is interested in input will ask this ...
6
votes
1answer
311 views
What are the benefits of designing a KeyBinding relay?
The input system of Quake3 is handled using a Keybinding relay, whereby each keypress is matched against a 'binding' which is then passed to the CLI along with a time stamp of when the keypress (or ...
6
votes
3answers
428 views
How standardized are joystick / gamepad configurations?
Right now I'm working on input for my game.
The only controller I own is an XBOX 360 one.
From what I can see, if a controller's stick has a Z axis, these are actually triggers.
Essentially I'm ...
6
votes
3answers
3k 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, ...
6
votes
2answers
1k views
multi touch on HTML5 with JavaScript?
How action game controls should be implemented so that they would work on smart phones as well?
At the moment I use wasd/arrow keys and I am able to handle for example two keys down at the same time.
...
5
votes
6answers
935 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 ...
5
votes
2answers
612 views
Checking for alternate keys with XNA IsKeyDown
I'm working on picking up XNA and this was a confusing point for me.
KeyboardState keyState = Keyboard.GetState();
if (keyState.IsKeyDown(Keys.Left) || keyState.IsKeyDown(Keys.A))
{
//Do stuff...
...
5
votes
1answer
360 views
Fighting Game and input buffering
In fighting game, there is an important thing called input buffering. When your character is doing an action, you can input the next action that will activate as soon as possible (the buffer is 5-10 ...
5
votes
4answers
530 views
Optimal touch controls for a twin-stick shoot 'em up?
So we recently launched a shoot 'em up arcade-type game (think Smash TV or I Made a Game with Zombies in It!). You can move in one direction and fire in another, so the ideal control scheme is ...
5
votes
1answer
464 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 ...
5
votes
1answer
208 views
Portable buffered keyboard input for XNA / MonoGame?
As a preliminary solution, I am currently using the Nuclex framework in an C#/XNA game project for buffered keyboard input. Sadly, nuclex relies on SlimDX.Directinput.dll and therefore to my knowledge ...
4
votes
3answers
2k 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 ...
4
votes
5answers
310 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 ...
4
votes
3answers
614 views
What's a good way to check that a player has clicked on an object in a 3D game?
I'm programming a 3D game (using C++ and OpenGL), and I have a few 3D objects in the scene, we can say they are boxes for this example. I want to let the player click on those boxes to select them ...
4
votes
11answers
350 views
Varying the strength of attacks by holding down the button
I am preparing a conference session about game design, and a question occurred to me that I haven't been able to answer with Google:
In Mario the player varies the height of Mario's jump by holding ...
4
votes
3answers
702 views
IDirect3DDevice9Ex and D3DPOOL_MANAGED?
So I wanted to switch to IDirect3DDevice9Ex, purely for the SetFrameLatency function, as fullscreen vsynced D3D seemed to produce noticable input lag.
But then it tells me 'ha ha ha! now you can't ...
4
votes
5answers
376 views
Will multi-touch become an important/standard method of input for PC games in the future?
We've seen that multi-touch on smartphones has been wildly successful. On the iPhone, in fact, it's the only tactile input the user can provide! However, I'm wondering how likely it'll be for ...
4
votes
5answers
553 views
Input/Output console window in XNA
I am currently making a simple game in XNA but am at a point where testing various aspect gets a bit tricky, especially when you have to wait till you have 1000 score to see if your animation is ...
4
votes
1answer
1k views
Unity MouseWheel weapon change
I am trying to make a simple weapon change in Unity3D. The best way to do this is with the mouse scroll wheel, as far as I can see.
I googled on how to do this and found that I have to use ...
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 ...
4
votes
1answer
210 views
Character Movement in 3D games
I'm either not searching correctly or there is really not a lot of material on Character Movement in 3D games.
I'm mostly interested in how people usually implement character movement in games like ...
4
votes
1answer
228 views
How would I handle input with a Game Component?
I am currently having problems from finding my way into the component-oriented XNA design.
I read an overview over the general design pattern and googled a lot of XNA examples. However, they seem to ...
3
votes
3answers
220 views
Unable to detect continuous keypress event in SDL
I am developing a game using SDL, and am unable to do continuous motion for my object when a key is held down.
I'm calling SDL_PollEvent() to retrieve all events during a frame, and passing each ...
3
votes
2answers
285 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 ...
3
votes
2answers
488 views
How do you test xbox (via PC) input without an xbox on XNA Game Studio?
Is it safe to just hookup a wired Xbox controller to my PC via USB? Do I need to buy a special PC Xbox controller? I've read conflicting reports. Any help is appreciated.
3
votes
3answers
680 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 == ...