I am writing a simple game in XNA where you move a sprite around using WSAD. The problem is if two keys of the same direction are pressed at the same time, the movement cancels out and the character does not move. Is it possible to manually set a key to released to avoid this? Here is the key movement code:
if (newKeyState.IsKeyDown(Keys.W))
{
position.Y -= vel;
}
if (newKeyState.IsKeyDown(Keys.S))
{
position.Y += vel;
}
if (newKeyState.IsKeyDown(Keys.A))
{
position.X -= vel;
}
if (newKeyState.IsKeyDown(Keys.D))
{
position.X += vel;
}