I'm making a game in C# (It's a pong game) and I've completed an "AI" so you can play 1 player, and I've also done a Multiplayer version, but, whenever someone hits a key (up or down) the other players' movement stops, and so on.
So basically you can't play 2 players because it would interrupt the other players movement. I am not sure what I need to do (Multithreading?) or some other kind of thing so that you can have a fluid play and not overlap the other players keystrokes.
I can't really search (even though i have) because i wouldn't know what to search for. :)
Anyways, hope there is a way hehe.
C# Form application (with tutorila game engine/library).
You are relying on the keyboard controller repeating the key when you hold it down. Yes, that stops working when you press another key.
The standard game loop approach is to use the KeyDown event to set a key-is-down flag and use the KeyUp event to reset it. Then in your game loop you check that flag and move the paddle when the flag is set. You could also pinvoke GetAsyncKeyState().