BluMess Forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Help me please

2 posters

Go down

Help me please Empty Help me please

Post by Fridgeclock Mon Dec 29, 2008 12:19 pm

I don's know if this should be in the flash section or what but can you help me with some as please?



This is probably very simple to fix but i cannot figure it out.
I have a character who moves with the WASD keys, but i need it so he plays his walking cycles when i press the WASD keys.

I have a player holding a gun. Inside that mc there is the gun mc and the player with the movement frames inside. On the main timeline the player moves with:

onClipEvent(enterFrame){
if(Key.isDown(65)){ //left
_root.player._x -= 5;
}
if(Key.isDown(68)){//right
_root.player._x += 5;
}
if(Key.isDown(83)){//down
_root.player._y += 5;
}
if(Key.isDown(87)){//up
_root.player._y -= 5;
}
}

and turns to follow the mouse.
Inside the mc i have the gun and the player with movements.
Inside there i have 4 frames.
1st frame: Standing still (Has stop ()Wink
2nd frame: Walking forwards/backwards
3rd frame: Walking left
4th frame: Walking right

on 2 frame, mc called "Characterwalking"
on 3 frame, mc called "playerleft"
on 4 frame, mc called "playeright"

Inside each of those mc's there is a stop(); on the first frame

Ok, i only told you all that incase you needed to know it to fix my AcSc.
What would you put in the WASD to make it play those frames?

Help please.

Fridgeclock
Newbie

Number of posts : 1
Registration date : 2008-12-28

Back to top Go down

Help me please Empty Re: Help me please

Post by BluMess Mon Dec 29, 2008 4:01 pm

For each of them, inside the brackets, put _root.player.gotoAndStop(FRAME GOES HERE)

e.g.
if(Key.isDown(65)){ //left
_root.player._x -= 5;
_root.player.gotoAndStop(3) //3 is the frame where the player faces left
}

Hope it helps Smile
BluMess
BluMess
Admin
Admin

Number of posts : 130
Location : Winchester
Registration date : 2008-02-29

http://www.blumess.com

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum