I'm working on a simple game, and I need help with making the animation more fluid. The way it's set up now, if I hold a key, it moves once, freezes, then moves fast. Is there any way I can just make it move at a set speed while the key is held down?
Here is the code for using the up arrow key to move the character up:
Here is the code for using the up arrow key to move the character up:
Code:
Clock.Interval = 40;
if (keyEvent.KeyCode == Keys.Up)
{
keyLastPressed = 2;
if (y > -10)
{
y -= 10;
}
Invalidate();
}