Tagged Questions
0
votes
1answer
135 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
80 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 ...
1
vote
0answers
39 views
Translating an object with a joypad
I'm trying to move a 3D plane with my mouse joysticks. At the moment my code, inside the Update method, is as follows:
xMin1 += Input.GetAxisRaw("LeftRight");
yMin1 += Input.GetAxisRaw("UpDown");
...
-1
votes
1answer
77 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
93 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
89 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
554 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
390 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
613 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
252 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
288 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
votes
2answers
1k views
C# XNA Handle mouse events?
I'm making a 2D game engine called Clixel over on GitHub. The problem I have relates to two classes, ClxMouse and ClxButton. In it I have a mouse class - the code for that can be viewed here.
...
1
vote
2answers
562 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
681 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
949 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 ...
2
votes
2answers
746 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
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 ...
3
votes
2answers
705 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
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 ...
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 ...
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 ...
3
votes
2answers
356 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. ...
