View Full Version : 1 question
theOFFSPRING
12-07-2005, 04:08 PM
I've been practicing flash since i last posted, and I've sorted out most of my problems with code, but i still have the problem with motion. I get how to make the character make 1 motion, but how would you make that to go to multiple animations and repeat?
Thanks in advance.
XGEN-CRaZeD
12-07-2005, 05:05 PM
I dont understand the question...
Neither, can you try and explain a bit more?
theOFFSPRING
12-08-2005, 03:15 PM
say you wanted to make the guy you're controlling walk. i can get one of the frames of him walking to come up while moving, but then it only stays at that one frame while he slides across the screen untill you let go of the key to make that movement. then it goes back to the character being idle. how would you nake the code so the the other frames of him walking come up as well?
quick ex.
http://img438.imageshack.us/my.php?image=tr3ck.swf
*note* that is NOT the game. just click on the game and move left and right using the arrow keys. think you can help?
do something like this
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
_xscale = -scale;
_x -= walkSpeed;
this.gotoAndPlay(2); // the frame with the guy walking
}
if (Key.isDown(Key.RIGHT)) {
_xscale = +scale;
_x += walkSpeed;
this.gotoAndPlay(2); // the frame with the guy walking
}
theOFFSPRING
12-08-2005, 04:28 PM
ok that helps a little. would you need to make a movie of him running and then make it loop untill you let go of that directional button?
just dont loop it and it wil lgo through once when you hit the button and stop if you let go
The Brown Cow
12-08-2005, 05:33 PM
The way I do it is a bit simpler.
Make a movieclip for your character. I imagine you already have one.
Now make a single frame for the walking. On that frame, create a movieclip (so you have a movieclip within a movieclip) with the looped animation of the walking character. Now if you gotoAndStop() on the frame with the animation, it will loop the animation for you. Leave the frame, and a different animation will play. This makes it easy to manage many animations for a single character.
theOFFSPRING
12-10-2005, 12:47 PM
Cool! thanks for that explanation, makes it a lot more clear :)
aslo... IT WORKS!!!
oh i thought thats what you were doing already
Logster
12-10-2005, 04:02 PM
when can we see the finished product?
theOFFSPRING
12-11-2005, 07:42 PM
The finished work won't release real soon. I'm working on a few more levels and workin out a few problems with the hit tests and some other coding. I'll post a preview soon when some of the bugs are fixed and i have, like say, 5 levels. I'm almost done with level 3;)
vBulletin® v3.7.3, Copyright ©2000-2010, Jelsoft Enterprises Ltd.