Quote:
Originally posted by Tyhm
If memory serves, all the nonlinear motion scripts he had came from me anyway, particularly the bird...
The trick is to modify this.xspeed and this.yspeed instead of x and y directly. So
if(dir=0) this.yspeed-=random(0.5,1); //try to go up - if you're going down, slow down some
//etc
while(abs(this.yspeed)>1) this.yspeed*=0.9; //maximum speed=1 tile per call
//etc
this.testy=y+this.yspeed;
//all the usual onwall: if it hits the wall, this.testy=y; this.testx=x;
y=this.testy;
You can get it from there easy. If you can't, give up, you're scripting out of your league.
|
well .. my idea for nonlinear was more of a real curve instead of just moving diagonally randomly..
if thats what u ment ;\