Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Olá Pessoal.
Peguei um código de chuva, com duplicate movieClip, ele tá funcionando de boa só que gostaria que as gotas caissem randomicamente, cada uma em seu tempo e não todas juntas.
Será que alguém pode me ajudar.
Segue o código fora do movie:
//////////// Agua ///////////////
for (k=20; k<50; k++) {
duplicateMovieClip(_root.mvAguaChuveiro.mvGota01, "mvGota01"+k, k);
}
Segue o código no movie:
onClipEvent (load) {
//specifies the size of the movie stage
movieWidth = 200;
movieHeight = 200;
i = Math.random()*7;
k = Math.PI+Math.random()*Math.PI;
//giving each snowflake unique characteristics
this._xscale = this._yscale=50+Math.random()*50;
this._alpha = 20+Math.random()*100;
this._x = Math.random()*movieWidth;
this._y = 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 = -10;
}
if ((this._x>=movieWidth) || (this._x<=0)) {
this._x = -10+Math.random()*movieWidth;
this._y = -10;
}
}Carregando comentários...