function bougeLesBulles(obj, depth, xPos, yPos, maxNum, randHeight, randWidth, Height, Width) {
this.createEmptyMovieClip(obj, depth);
this[obj]._x = xPos;
this[obj]._y = yPos;
for (i=1; i<=maxNum; i++) {
this[obj].attachMovie("bulle_mc", "bulle"+i, depth+i);
this[obj]["bulle"+i].tempo = random(7)+5;
this[obj]["bulle"+i].randVal = random(4);
this[obj]["bulle"+i].direction = -1;
this[obj]["bulle"+i].ZS = random(50)+10;
this[obj]["bulle"+i]._xscale = this[obj]["bulle"+i].ZS;
this[obj]["bulle"+i]._yscale = this[obj]["bulle"+i].ZS;
this[obj]["bulle"+i]._y = random(randHeight);
this[obj]["bulle"+i]._x = random(randWidth);
this[obj]["bulle"+i].onEnterFrame = function() {
this._y -= this.tempo;
this._x -= this.randVal;
this.randVal += this.direction;
if (this._y<=0) {
this._y = Height;
this.randVal = random(4);
this.tempo = random(7)+5;
this.ZS = random(50)+10;
}
if (this._x<=0) {
this._x = Width-this._width;
}
if (this._x>=Width) {
this._x = 0+this._width;
}
if (this.randVal<-3) {
this.direction = +1;
}
if (this.randVal>3) {
this.direction = -1;
}
};
}
}
bougeLesBulles("scene", 1, 0, 0, 30, 600, 800, 600, 800);
Partager