Hey, I've decided to start learning as3 and I've got a prob.
I can only see what the last key pressed was.
Say I have the W and D down, it would only say that one or the other is being pressed.
So I can't find if two or more keys are being pressed at the same time.
stage.addEventListener (KeyboardEvent.KEY_DOWN, keydown);
private function keydown(e:KeyboardEvent)
{
if(e.keyCode == 37)
{
this.xvel -= this.speed;
}
if(e.keyCode == 39)
{
this.xvel += this.speed;
}
if(e.keyCode == 32 && !this.jumping)
{
this.jumping = true;
this.onGround = false;
this.yvel = -16;
}
}