PDA

View Full Version : [AS3] Multple Inputs, Damage Pop-Ups


Darksydaz
06-25-2009, 08:23 PM
I've been reading a couple of tutorials about how to use multiple inputs, I'm using Selocular's Key input system and I'm trying to use arrays and timers to create a dash system (press forward, forward). Eventually will give way to other Multiple Inputs... I'm trying to figure out where to start for multiple key presses...

i was thinking

if (key.isdown(LEFT)) {
if (dash == false) {
player.x -= 5
dash.start();
} else {
player.x -= 10
}
} else {if (key.isdown(LEFT)) {
if (dash == false) {
player.x += 5
dash.start();
} else {
player.x += 10
}
} else {
if (dash == true) {
dash=false;
}
}

function dashtrig (ev:TimerEvent):void {
dash=true;
secondPress.start();
}

function secondPress (ev:TimerEvent):void {
dash=false;
}


dashtrig would start after .2 seconds, and then second press would start after .5 seconds. Meaning you have a 5 second window to press it... but i'm thinking there has to be a better method (using arrays and such) but i can't think of it...

//end Multiple Inputs, Start Damage Pop Ups

I've haven't the clue as to how to make damage pop up over a enemy (or player's head). I was wondering if someone could provide a place to start... cause i'm lost... :(

Darksydaz
06-26-2009, 03:57 AM
I tried thir first method using multiple timers, but with no way to track Selocular Key is up... i've found it near impossible....