Time for us to make it look like a tornadoā¦
The good thing now is that all we have to mess with is the last loop, by changing a little bit the variables we are using.
1. First thing
Increase the maxClip a bit. Something like 150-200. And define 2 new variables:
maxHeight=400;
It refers to the height of the tornado.
2. Messing with the variables
So first, we want to give our tornado the right shape. This means that the radius of the particles at the bottom is smaller than the one of the top of the tornado.
Change the for loop into this
for (var i=0;i < maxClip;i++){
mc=dot.duplicateMovieClip("dot"+i,i);
mc.angle=0;
mc.starty=2*i;
mc.radius=mc.starty/2;
mc.onEnterFrame=rotate;
}
Notice that the radius depends on the _y position, so you should define the radius AFTER the _y positionā¦ And I divided by 2 to make it look better. You can try with any number, or nothing at all.
You should now have something like a line the describing a circle, or something like thatā¦
3. The tornadoā¦
The problem is that all the dots are aligned. To solve that, all we have to do is to give the dots a random angle to start with
mc.angle=random(360);
I know, the tornado is upside down, but weāll solve that problem later
4. A bit of randomness
We are also going to position our dots randomly on the _y axis (the mc.starty variable).
mc.starty=random(maxHeight);
Thereās not really a big difference with the previous one, but randomness is always funā¦
5. Upside Down
To flip it, just change one tiny thing
mc.radius=(maxHeight-mc.starty)/2;
You can also give a minimal radius
mc.radius=(maxHeight-mc.starty)/2+10;
Thatās it for Part Trois.
pom :asian: