# Snowing upwards?

**URL:** <https://forum.kirupa.com/t/snowing-upwards/139892>\
**Category:** Uncategorized\
**Created:** [March 6, 2005, 7:16pm UTC](https://forum.kirupa.com/t/snowing-upwards/139892 "2005-03-06T19:16:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Photogenius](https://avatars.discourse-cdn.com/v4/letter/p/50afbb/32.png) [@Photogenius](https://forum.kirupa.com/u/Photogenius)\
**Post date:** [March 6, 2005, 7:16pm UTC](https://forum.kirupa.com/t/snowing-upwards/139892/1 "2005-03-06T19:16:20Z")

</div>

On the snow 2.0 tutorial, how do you make it snow upwards. This is the code that controls that sort of thing (I think):  
[size=1][color=royalblue]onClipEvent (load) {[/color][/size]  
[size=1][color=royalblue]//variables[/color][/size]  
[size=1][color=royalblue]width = 300;[/color][/size]  
[size=1][color=royalblue]height = 200;[/color][/size]  
[size=1][color=royalblue]//random x,y, and alpha [/color][/size]  
[size=1][color=royalblue]this.\_xscale = this.\_yscale=50+Math.random()_100;[/color][/size]  
[size=1][color=royalblue]this.\_alpha = 20+Math.random()50;[/color][/size]  
[size=1][color=royalblue]//random x and y for flakes[/color][/size]  
[size=1][color=royalblue]this.\_x = -width+Math.random()(3_width);[/color][/size]  
[size=1][color=royalblue]this.\_y = -10+Math.random()\*height;[/color][/size]  
[size=1][color=royalblue]//speed and trigonometric value[/color][/size]  
[size=1][color=royalblue]i = 1+Math.random()\*2;[/color][/size]  
[size=1][color=royalblue]k = -Math.PI+Math.random()_Math.PI;[/color][/size]  
[size=1][color=royalblue]rad = 0;[/color][/size]  
[size=1][color=royalblue]}[/color][/size]  
[size=1][color=royalblue]onClipEvent (enterFrame) {[/color][/size]  
[size=1][color=royalblue]// horizontal movement[/color][/size]  
[size=1][color=royalblue]rad += (k/180)Math.PI;[/color][/size]  
[size=1][color=royalblue]xmovement = \_root.\_xmouse;[/color][/size]  
[size=1][color=royalblue]this.\_x -= Math.cos(rad)+(xmovement-(width/2))/50;[/color][/size]  
[size=1][color=royalblue]// vertical movement[/color][/size]  
[size=1][color=royalblue]this.\_y += i;[/color][/size]  
[size=1][color=royalblue]// remove clips when they misbehave (overstep boundaries)[/color][/size]  
[size=1][color=royalblue]if (this.\_x\>(width+50)) {[/color][/size]  
[size=1][color=royalblue]this.\_x = -45;[/color][/size]  
[size=1][color=royalblue]this.\_y = Math.random()height2;[/color][/size]  
[size=1][color=royalblue]}[/color][/size]  
[size=1][color=royalblue]if (this.\_x\<-50) {[/color][/size]  
[size=1][color=royalblue]this.\_x = width+45;[/color][/size]  
[size=1][color=royalblue]this.\_y = Math.random()height2;[/color][/size]  
[size=1][color=royalblue]}[/color][/size]  
[size=1][color=royalblue]if (this.\_y\>=height) {[/color][/size]  
[size=1][color=royalblue]this.\_y = -50;[/color][/size]  
[size=1][color=royalblue]this.\_x = -width+Math.random()(3_width);[/color][/size]  
[size=1][color=royalblue]}[/color][/size]  
[size=1][color=royalblue]}[/color][/size]

could you tell me? Im sure its not that difficult, because Ive managed to get it to snow in both directions, but I want it going up, and I dont want it to go outside the boundry.
