-
using keyboard for movement - eliminating the slight pause
As some of you may know, there is a slight pause after you hold in one key, so the computer knows wether to enter it in again or not. Once it decides you want tons of that letter in the text, then it rapidly speeds up. (If you don't know what I'm talking about, go to your URL bar and press and hold a, look for that pause.)
My source code, which reads (translated): Upon holding in the <Right> key, _x += 2.
I've noticed that same slight pause while holding in the <Right> key, and that offsets the movement by quite a bit.
I would like a solution that gets rid of the pause and, most importantly, works for all computers (aka doesn't involve changing keyboard controls manually).
Any ideas?
Last edited by Rellin; 03-05-2005 at 11:14 AM.
-
whats your actual source code?
i used this :
PHP Code:
if (Key.isDown(KEY.RIGHT)) {
_x +=5;
and that works fine without the pause or anything,
Im using mx2004 btw,
beedle
-
I was using on(keyPress("<Left>")){ as my code. I can't get yours to work. In what on/onClipEvent handler do I put it in?
-
Senior Member
He's probably doing it in an enterframe handler, like so:
code:
onClipEvent(enterFrame)
{
if (Key.isDown(Key.LEFT))
{
// handle left key
}
if (Key.isDown(Key.RIGHT))
{
// handle right key
}
// etc...
}
This tends to work better for games...
-
Yea, im using an onClipEvent(EnterFrame) handler,
beedle
-
aaaah, I should've known that.
Thanks much!
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
|