Hi all,
I have an animation based upon the excellent falling snow tutorial. My animation is falling leaves. Now, in the falling snow tutorial random rotation wasn’t a problem because all the objects were circles. I’d really like randomness in the leaves, I’ve added a line of code to the original AS - it should be in bold… am I on the right track?
onClipEvent (load) {
// specifies the size of the movie stage
movieWidth = 600;
movieHeight = 500;
// variables that will modify the falling leaves
i = 1+Math.random()*2;
k = -Math.PI+Math.random()*Math.PI;
// giving each leaf unique characteristics
this._xscale = this._yscale=50+Math.random()*100;
*this._rotation = this._rotation=360+Math.random()100;
this._alpha = 60+Math.random()*100;
this._x = -15+Math.random()*movieWidth;
this._y = -15+Math.random()*movieHeight;
}
onClipEvent (enterFrame) {
// putting it all together
rad += (k/180)*Math.PI;
this._x -= Math.cos(rad);
this._y += i;
if (this._y>=movieHeight) {
this._y = -5;
}
if ((this._x>=movieWidth) || (this._x<=0)) {
this._x = -10+Math.random()*movieWidth;
this._y = -5;
}
}
What can I say I’m just not a coder.