Well im making my own game just to see if I am capable to do this. Anyways, i have created a stick man and put it in a movie clip where he can run and i used action script... very basic
which can make him move left or right and even up.... The thing is he can run out and when i stop he doesnt stop... He runs on the spot...
So i made another movie clip... This time hes still... and I made my running person on a different frame... But its just like hes stopped but moving side to side... heres that code
I want i can recall animations on different frames so he can jump, kick, punch, stop, and run... Can someone help me???
<br>onClipEvent (load) {<br> speed = 10;<br>}<br>onClipEvent (enterFrame) {<br> if (Key.isDown(Key.RIGHT)) {<br> _x += speed;<br> }<br> if (Key.isDown(Key.LEFT)) {<br> _x -= speed;<br> }<br> if (Key.isDown(Key.SPACE)) {<br> _y -= speed;<br> }<br>}<br>
AbnormalIdiot, i tried doing the thing u said... where it stops on the selected frame on the character... But it doesn't stop... It like still runs on the stop...
and just to tell you guys... im not writing the action script within the movie clip... i just clicked the movie clip and started writing the action script with in the timeline...
It's because you're telling the character to goto the frame with him standing still, and you probably have a stop command in that frame. Try _root.character.gotoAndPlay(2);
i dont have a stop in there and i tried it with gotoandplay2 and it still doesnt work... i've been trying to work with it and i got him to turn left and right and jump heres the stuff
Anyways i have a movie clip which has 4 frames Those 4 frames are used to show my guy running
the thing is when i stop controlling him... its like hes running on the spot... how do i make it so he stops... and i also want to know how to make him sorda do a run jump... I have the jump part but its like he runs in the air and also... if i hold down the jump button its like he on a rocket... he keeps going up untill i let go...
Oh, my mistake, I misunderstood. For the jumping problem, you need to slowly decrease jumpspeed, and have it start at, say, 30. Each frame after _y -= jumpspeed; add jumpspeed -= 0.5 or something like that.
To make your character stop running in the air, add this inside the if commands for left and right: && !Key.isDown(Key.SPACE)
For the running thing, have your first frame be of the character standing still, and the 4 after that the running animation. On the last of the 4 running animation frames, use gotoAndPlay(2); And do something like:
if((!Key.isDown(Key.LEFT) && !Key.isDown(Key.RIGHT)) or Key.isDown(Key.SPACE)) { gotoAndStop(1); }
For the running jump, add something like: if(Key.isDown(Key.SPACE) && (Key.isDown(Key.RIGHT) or Key.isDown(Key.LEFT))) { _root.character.gotoAndStop(5); //or gotoAndPlay(5); but you need frame 5 to be/start the running jump animation. }
THANKS AlOT ABNORMAL!!!!! This is what i did... on my first frame i put it stop(); where he would stay... and on my second frame.. i put a movie clip with in a movie clip and made it go to my running and its running and it STOPS!!!
okay nvm... i still have a problem... I have a movie clip the first frame is my guy stopped i put an stop action script in there
in my second frame... i added another movie clip this time there is 6 frames with in that movie clip where he is supposed to run... the thing is it only shows 2 frames of the 6.... Heres the code for my character
okay i did it... I erased the other idea... and put my running animation all in the first 5 frames and on the last frame i made it go back to frame 1... and on frame 6 i had him stopped and i put a stop command in there... and i used !KeyisDown(Key.LEFT) && !KeyisDown(Key.RIGHT)) { _root.character.gotoAndStop(6); }