Hi everyone, I got a problem and would really appreciate some help...
I've been trying to code a sidescrolling shooter, much like Metal Slug. Progress has been going relatively well, but I've run into some problems...
I can't get the "shooting in four directions" bit right.
Here's the code:
if (Key.isDown(Key.UP) && (Key.isDown((88)))) {
gotoAndStop(5)
//This plays the shooting UP animation.
}
if (Key.isDown(Key.DOWN) && (Key.isDown((88)))) {
gotoAndStop(6);
//This plays the shooting DOWN animation.
}
The code makes it so you have to HOLD the UP key and the X key to shoot up, and the DOWN key and the X key to shoot down.
Now that actually does work, problem is, when it goes to the frame in the Hero MC that plays the shooting animation, it doesn't play the MC on that frame when both keys are held down! It simply stays stuck on the first frame of the animation. However, if you release both keys at the same time it plays the shooting animation on that frame. I just don't know how to fix it.. I've looked everywhere; AS: Main, Google, Flashkit, and have turned up with no remedy for this problem. If someone could lend me a hand with the code, or point me in the direction of a tutorial that would suit my needs, I'd be very thankful.