[F8] Can't find good random motion tutorial ANYWHERE!
Please can someone help? I've looked everywhere for a good random motion tutorial, and i've found quite a few! But none of them get the object to face in the direction it is moving. I am currently making a cool game called Pligas. It's going to be a bit like the microlife game , and that's exactly the sort of random motion I want. Please?
14yr old Member
please download the attached .fla
Attached Files
14yr old Member
do your characters already randomly move like in micro life? if they do can you please tell me how to do that?
ps: thats not a lizard its a pokemon
Thanks, that kind of helps... but if we could mix that with a random motion script like this:
Code:
onClipEvent (load) {
//data you may want to change
width = 550;
height = 400;
speed = Math.round(Math.random()*2)+1;
//initial positions
x = this._x=Math.random()*width;
y = this._y=Math.random()*height;
x_new = Math.random()*width;
y_new = Math.random()*height;
}
onClipEvent (enterFrame) {
//x movement
if (x_new>this._x) {
sign_x = 1;
} else {
sign_x = -1;
}
dx = Math.abs(x_new-this._x);
if ((dx>speed) || (dx<-speed)) {
this._x += sign_x*speed;
} else {
x_new = Math.random()*width;
}
//y movement
if (y_new>this._y) {
sign_y = 1;
} else {
sign_y = -1;
}
dy = Math.abs(y_new-this._y);
if ((dy>speed) || (dy<-speed)) {
this._y += sign_y*speed;
} else {
y_new = Math.random()*height;
}
}
It would be PERFECT!
The thing is, I'm only 11 years old, so I'm not the best scripter, but we could TRY to get it working.
Also, I know that thing is a pokemon, but, it's like a lizard pokemon lizardy thingy. I'm mad about lizard's, I even have a pet one!
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width