|
-
Feb 17th, 2004, 04:15 AM
#1
Thread Starter
New Member
[Resolved]common(i think) KeyDown problem[Resolved]
Hello,
I'm trying to write a little 2D game that responds to the arrow keys for navigational input.
This all works fine so far save one error.... and i'm sure this is not the first time this has come up......
When i press and hold the directional buttons down it registers the first movement but however there is a pause before it registers the fact that i've still got the key pressed down, and so the character pauses briefly on the screen before continuing in the direction it was traveling.
I've split navigation into 4 sub's
OnKeyDown
Uses an enumerator to set which direction the character is traveling depending on which key is pressed
OnKeyUp
Set's the same enumerator to imply that the character has now stopped moving.
On Timer Tick
I have a timer which ticks every 50ms
If the enumerator is set to a direction then it recalculates the position of the character in the form of two integers(x,y)
DrawCharacter
GDI+ Function that displays the character to the screen at current position
I've tried Increasing/Decreasing the interval on the timer to no avail.
I'm presuming this is not an uncommon problem?
Last edited by Superfly1611; Feb 17th, 2004 at 06:55 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|