View Full Version : randomly move a MC left and right

07-01-2001, 10:27 AM
I want to know how i should write a script for an MC that should randomly move left or right plus a random distance (sometimes it goes more sometimes it doesn't go so far).. (please help me with the speed too!). Everything should be within bounds.

Please help me!! :( thanks a load

07-01-2001, 04:07 PM
You need to make a frames loop.
Frame 1: define a speed and change direction
Frame 2: move the MC a _x+speed distance
Frame 3: gotoandPlay frame2 any number of times your counter might like
Frame 4: decide if change the direcction with something like: if(random(2)==1)
{gotoandplay(1)} else {gotoandplay(2)}

I'm not sure if that's helpful. The idea is that you must loop the movement between the MC frames.
Sorry can't post a .fla yet. Good Luck!

07-02-2001, 03:15 AM
also see the actionscripted movement tutorial