1
vote
1answer
57 views

XNA - Prevent Holding of Mouse Button as Part of an Input Handler Game Component

I'm using C# XNA 4.0 Refresh. I'm working to create an InputHandler Game Component for my XNA game to handle all of the keyboard and mouse input. I used SixOfElevens RPG Game Tutorial (Here - ...
1
vote
2answers
142 views

Input of mouseclick not always registered in XNA Update method

I have a problem that not all inputs of my mouse events seem to be registered. The update logic is checking a 2 dimensional array of 10x10 . It's logic for a jewel matching game. So when i switch my ...
2
votes
1answer
146 views

When do you get Mouse.getstate().X or Y as negative?

I am creating a game in which I use a function: int x() { int px = 100; int pxend = 128; int xx = 0; for (int i = 0; i < 6; i++) ...
0
votes
0answers
91 views

Top down 2D camera in relation to keyboard commands

I have a basic 2D camera: transform = Matrix.CreateTranslation(-position.X, -position.Y, 0) * Matrix.CreateRotationZ(-rotation) * Matrix.CreateScale(new Vector3(zoom, zoom, 1)) * ...
-1
votes
1answer
209 views

XNA Framework doesn't recognise controller [closed]

So just a little bit of XNA code: if (this.IsActive && (Keyboard.GetState().GetPressedKeys().Length > 0 || Mouse.GetState().LeftButton == ButtonState.Pressed || ...
9
votes
1answer
575 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 ...
1
vote
2answers
415 views

Key-Binding in XNA

I have been thinking about this issue for a while now and my recent efforts to find an already existing answer have not been successful. I am trying to implement a menu system via which the player ...
1
vote
1answer
137 views

If statement causing xna sprites to draw frame by frame

I’m a bit new to XNA but I wanted to write a simple program that would fire a cannon ball from a cannon at a 45 degree angle. It works fine outside of my keyboard i/o if statement, but when I ...
4
votes
5answers
2k 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
442 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 ...
5
votes
2answers
699 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
2answers
864 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... ...
-2
votes
2answers
312 views

Inputting cheat codes - hidden keyboard input

Okay, here's what I want to do - when the player is at the main menu, I want them to be able to type in cheat codes. That's the only place I want it to work. I don't want to give them a text box to ...
0
votes
1answer
181 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
3answers
914 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 ...
0
votes
0answers
31 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 ...
3
votes
3answers
791 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 == ...
3
votes
2answers
997 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 ...
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 ...
5
votes
1answer
637 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 ...
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 ...
3
votes
1answer
278 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?
11
votes
6answers
14k 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 ...
8
votes
5answers
2k 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. ...
1
vote
1answer
566 views

Tetris Movement - Implementation

I'm developing a Tetris clone and working on the input at the moment. When I was prototyping, movement was triggered by releasing a directional key. However, in most Tetris games I've played the ...
12
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 ...
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 ...
3
votes
2answers
524 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.