I have a character that you can control, but the problem is that when he jumps he is still. I want him to be running then you jump and kick like a combo sort of. How do you make him do something as he is jumping?
First, you need a set of frames for the kick animation. Then, In your code where you tell the character to jump add: if(xspeed > 0 or xspeed < 0) // assuming you have an xspeed variable { _root.character.gotoAndPlay(2); // assuming the kick animation starts at frame 2. }
And in the last frame inside the character add: gotoAndStop(1);
First of all, I'm gonna teach your a couple shortcuts. Instead of using "this._x" you can just use "_x" and instead of using "_y = _y + 10;" you can use "_y += 10;"
Second of all, your code, if it worked properly, would make you move twice as fast to the left or right when alt is pressed. Instead, right after checking if the right arrow key is pressed add:
else if(Key.isDown(Key.ALT) && Key.isDown(Key.RIGHT)) { _y += 10; _x += 10; } And do the same thing after left, but lower the x value instead of increasing it.
For some reason, anything using the alt key isn't working. Maybe you could use space?
VoidCrystal: Nope, actually I can't help most people, I've just gotten lucky recently =P
AbnormalIdiot is right. If that doesn't work, try making a button like spacebar jump. Keyboards are hooked up weird; sometimes certain keys won't work when pressed at the same time