First,Sorry for my English. I wanted to make a flash game,it's about some fish swiming in a tank. All the fishes swim randomly,i don't need any rotation,just left and right direction will be fine with me. But the result is their actions are really odd. Can someone tell me how to make them swim just like real fishes?
And there's also another problem.When the number of fishes increased to 50 or more,the framerate will drop rapidly.
Sorry for my English again.
Now I use Tweenlite to control the swiming action ,and it works very well.But the framerate still drops if i add more than 40 or 50 fishes to the tank.I think there must be a better way to do this.
Here's my code
public function onEnterFrame(event:Event):void{
var time:Number = Math.sqrt(Math.pow(xOffset,2)+Math.pow(yOffset,2))/speed;
TweenLite.to(this,time,{x:x+xOffset ,y:y+yOffset*0.5 ,ease:Quad.easeOut,onComplete:moveComplete});
}*/
xOffset and yOffset in the code are random numbers