00:00
00:00
Newgrounds Background Image Theme

markololohands just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Foss: Double Tap Keys

1,616 Views | 3 Replies
New Topic Respond to this Topic

Foss: Double Tap Keys 2005-11-13 01:37:07


Foss: Main

What Are Double Tap Keys?
That's when you make action's that can only be used when a specific key is pressed twice within a certain time period.

lets say you wantd trace thee word "OMG" when "a" is doubletapped. you would use

onClipEvent (enterFrame) {
if (Key.isDown(Key.SPACE) && !hit) {
hit = true;
if (lastPress && getTimer()-lastPress<500) {
trace("omg");
}
lastPress = getTimer();
} else if (!Key.isDown(Key.SPACE)) {
hit = false;
}
}

thats it!
highly customisable!
double tap left/right to run or while holding down(duck) to roll

Response to Foss: Double Tap Keys 2005-11-13 01:38:43


im sorry not when "a" is double tapped, when SPACE is doubleTapped

Response to Foss: Double Tap Keys 2005-11-13 01:40:10


At 11/13/05 01:37 AM, ImpotentBoy2 wrote: What Are Double Tap Keys?

only the most highly-useful thing ever...

lets say you wantd trace thee word "OMG" when "a" is doubletapped. you would use

onClipEvent (enterFrame) {
if (Key.isDown(Key.SPACE) && !hit) {
hit = true;
if (lastPress && getTimer()-lastPress<500) {
trace("omg");
}
lastPress = getTimer();
} else if (!Key.isDown(Key.SPACE)) {
hit = false;
}
}

change "Key.SPACE" to 65, and thats true ^_^
great job. way to get FOSS back on its feet...


BBS Signature

Response to Foss: Double Tap Keys 2005-12-17 17:32:02


At 11/13/05 01:40 AM, authorblues wrote:
At 11/13/05 01:37 AM, ImpotentBoy2 wrote: What Are Double Tap Keys?
only the most highly-useful thing ever...

thanks... that took a load off my mind