00:00
00:00
Newgrounds Background Image Theme

JustAndrew just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

FOSS: snow from mouse

1,803 Views | 8 Replies
New Topic Respond to this Topic

FOSS: snow from mouse 2005-11-19 14:07:23


FOSS: main

first make a new movie clip (which will be the snow) and give it the instance name of "snow", without quotes

then put this code on it

onClipEvent(load){
speedy=random(5);//creates the speed variables
speedx=random(1);
_x=_root._xmouse//makes the snow flaske move to mouse position
_y=_root._ymouse
}
onClipEvent(enterFrame){
if(_x>Stage.width || _x<0 || _y<0 || _y>Stage.height){//if the snowflake goes off screen it will be removed
this.removeMovieClip();
}
}
onClipEvent(enterFrame){
_y+=speedy;// makes the snow flaske go down and right
_x+=speedx;
if(speedy<0.5){// so the snowflake dosent move too slow
speedy=0.5}
if(speedx<0.5){
speedx=0.5}}

now on the frame where the movie clip is put these actions

sc = 0;
_root.onMouseMove = function() {
sc++;
if (sc>500) {
sc = 0;
}
duplicateMovieClip("snow", sc,sc);
};

if all has gone well, you should end up with somthing like
this

Response to FOSS: snow from mouse 2005-11-19 14:11:44


At 11/19/05 02:07 PM, -reelbigcheese- wrote: FOSS: main
if all has gone well, you should end up with somthing like this

the effect is nice, but obscure. this seems like a mod of all that "rain from mouse" FOSS that spam made a while back. im not saying this isnt good in its own right, though. looks nice.


BBS Signature

Response to FOSS: snow from mouse 2005-11-19 14:16:57


At 11/19/05 02:07 PM, -reelbigcheese- wrote: if all has gone well, you should end up with somthing like this

Pretty cool

*thumbs up*

<3


Sup, bitches :)

BBS Signature

Response to FOSS: snow from mouse 2005-11-19 14:17:11


argh! why must people refuse to declare variables!

Response to FOSS: snow from mouse 2005-11-19 14:19:03


thank you
XD

Response to FOSS: snow from mouse 2005-11-19 14:20:08


Weee @ variables! :D

var speedy:Number = random(5);
var speedx:Number = random(1);


BBS Signature

Response to FOSS: snow from mouse 2005-11-19 14:21:55


At 11/19/05 02:20 PM, -Toast- wrote: Weee @ variables! :D

var speedy:Number = random(5);
var speedx:Number = random(1);

Weeeeeeee @ variables =\

var speedy:Number = new Number(Math.round(Math.random()*5));
var speedx:Number = new Number(Math.round(Math.random()));


Sup, bitches :)

BBS Signature

Response to FOSS: snow from mouse 2005-11-19 14:21:58


At 11/19/05 02:11 PM, authorblues wrote: the effect is nice, but obscure. this seems like a mod of all that "rain from mouse" FOSS that spam made a while back. im not saying this isnt good in its own right, though. looks nice.

yeah but mines better lol
=O

Response to FOSS: snow from mouse 2005-11-19 14:24:21


At 11/19/05 02:17 PM, dELta_Luca wrote: argh! why must people refuse to declare variables!

What are the advantages of declaring them?