Sneeuw valt aan de foute kant

Status
Niet open voor verdere reacties.

Smartguy

Meubilair
Lid geworden
13 jul 2001
Berichten
7.240
Ok, ik heb op andere forums nog geen antwoord gekregen dus doe ik het hier maar proberen.

Ik heb een script waardoor sneeuw omlaag valt.
Alles goed en wel, alleen valt de sneeuw aan de foute kant van het beeld (trek een lijn tussen je beeldscherm en dan valt de sneeuw links inplaats van rechts).

Nu wil ik weten hoe ik dit moet oplossen...

Dit is het script:

Code:
onClipEvent (load) {
	//specifies the size of the movie stage
	movieWidth = 403;
	movieHeight = 480;
	
	//variables that will modify the falling snow
	i = 1+Math.random()*2;
	k = -Math.PI+Math.random()*Math.PI;
	
	//giving each snowflake unique characteristics
	this._xscale = this._yscale=50+Math.random()*100;
	this._alpha = 75+Math.random()*100;
	this._x = -10+Math.random()*movieWidth;
	this._y = -10+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;
	}
}

Hoe krijg ik dus de sneeuw van de linkerkant naar de rechterkant?

Alvast bedankt!
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan