Well the way I do it is that I store what the 4 key positions are like :
VB Code:
Private keyLeft As Boolean Private keyRight As Boolean Private keyUp As Boolean Private keyDown As Boolean
So when the user presses a key, it sets two of the above to either True or False. If the user presses Right, then keyRight is True, and keyLeft is False.
And then in the timer event (though I normally use GetTickCount), I check is keyLeft or keyRight true, and if one of them is, then move the person in that direction, and then set it to false.
Same for up/down.
Ya follow ?




Reply With Quote