0
votes
2answers
151 views

Problem with moving player through a secript by a set distance

I am currently trying to add a sort of "dash"-ability to my sidescroller. What I try to do, is to let the player press a key where a simple key-press causes the player to move quickly into one ...
0
votes
0answers
33 views

XNA Guide text input - maximum length

so I am using Guide.BeginShowKeyboardInput to get the user to enter their username. I would like this to be limited to 20 characters, and it seems to break expected behaviour to let them input ...
0
votes
0answers
85 views

class instance issue

Currently, i am working on a project which deals with several parts. First, I want to interface with a Sidewinder Force Feedback 2 joystick in Unity using SharpDX and SharpDX.DirectInput libraries. ...
1
vote
1answer
82 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
180 views

Can I trigger input/controls via code?

I have the 3rd person controller in my game, which moves with the WASD keys. But since I am developing for a mobile release, I want touch controls. I have already the touch control-script in a new ...
0
votes
0answers
15 views

Grab mouse input in OpenTK? [duplicate]

I've searched a lot on the Internet but I can't seem to find any code that works with the current OpenTK, that "grabs" the mouse input (just gives the delta-x and delta-y, for camera rotation for ...
0
votes
1answer
233 views

How to prevent the player from clicking too fast [closed]

I'm having trouble with some bullets in my game, the M1911, which is supposed to be semi-auto is only capable of shooting one projectile per mouse click (trying to learn how to do multiple ones at ...
1
vote
1answer
458 views

Can not enable IME to capture Chinese characters in SharpDX

Just found that direct integration of IME is blocked in Windows 8, moving on to TSF now. By now, there is lack of Microsoft's Document about TSF, this will be hard. I am using SharpDX and the ...
0
votes
1answer
126 views

Why does my object “jump” immediately as the game starts?

I'm having a problem where, when I start my game, my game object (a 3D plane) immediately jumps 300 pixels or so. I suspect this has something to do with my joystick handling code that I've written to ...
-1
votes
1answer
254 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 || ...
2
votes
1answer
337 views

Translating a terrains position using input in Unity 3D C#

I am trying to make a terrain in Unity move, but im having trouble. Here's the code i have. using UnityEngine; using System.Collections; public class NewScript : MonoBehaviour { Camera camera; ...
1
vote
3answers
529 views

Unity3D smooth movement with joypad button press

First off, I'm sorry this is such a silly question, but for the life of me I can't seem to get it to work. And I've just spent the last hour trying to do so. All I want to do is have my camera move ...
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 ...
1
vote
1answer
594 views

Input Handling and Game loop

So, I intercept the WM_KEYDOWN and other messages. Thing is, my game can't/shouldn't react to these messages just yet, since my game might be currently drawing to the screen or in the middle of ...
5
votes
2answers
933 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
336 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 ...
2
votes
1answer
395 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 ...
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 ...
3
votes
3answers
822 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
1answer
1k 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 ...
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
681 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 ...
3
votes
2answers
935 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 ...
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 ...
10
votes
5answers
801 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 ...
11
votes
6answers
15k 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 ...
3
votes
2answers
373 views

Where should input be used?

I'm working on an input system (in C#) and now I'm wondering, what is the best place to put input functionality? Currently what I was coding was a bunch of delegates which act as callbacks (i.e. ...