00:00
00:00
Newgrounds Background Image Theme

4ng3lzh4untm3 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!

if(Key.isDown) / gotoAndPlay HELP!

531 Views | 2 Replies
New Topic Respond to this Topic

AS2 Help Please?
Here is the main code that I am working with:

function onEnterFrame() {
if(alive == true){
background._x -= Speed;
Player._y += gravitypull;
gravitypull += gravity;

if(Key.isDown(Key.UP)){
Player._y -= 10;
gravitypull = maxJump;
}
if(Key.isDown(Key.SPACE)){
_root.player.playeractions.gotoAndPlay(4);
}

Everything above seems to work okay, but here's the thing: when I push (SPACE), it proceeds to go to the animation where the player is shooting; which is frame 4. But I DON'T UNDERSTAND why it STOPS PLAYING at the first frame and gets stuck. It wont continue the animation. When I let go of the button, it goes back to normal, which I want. But when I push it, it doesn't want to play the animation, just the first frame.

Been working on this for a while, even tried event listeners and everything.

Response to if(Key.isDown) / gotoAndPlay HELP! 2015-09-06 12:13:42


I figured it out

Response to if(Key.isDown) / gotoAndPlay HELP! 2015-09-06 13:36:20


At 9/6/15 01:29 PM, SwisherCovent wrote:
At 9/6/15 12:13 PM, AcesArco wrote:

I took out the last code, and placed that code on the shooting animation itself