Join for FREE | Take the Tour Lost Password?
[x]

deviantART

 

have a break.. by ~Ralfi:iconRalfi:


©2009 ~Ralfi
:iconralfi:

Artist's Comments

I have to do some project for my studies so I made random animation :P

I dedicate it to :iconstachuuu: because it's his birthday ;)


//ActionScript 2.0.
var n:Number = 100;
this.createEmptyMovieClip("points", this.getNextHighestDepth());
for (var i = 0; i<n; i++) {
this.points.createEmptyMovieClip("p"+String(i), this.points.getNextHighestDepth());
var p:MovieClip = this.points["p"+String(i)];
p._x = random(Stage.width);
p._y = random(Stage.height);
p.lineStyle(5, random(0xFFFFFF), 100);
p.moveTo(0, 0);
p.lineTo(0, 1);
}
this.onMouseMove = function() {
for (var i = 0; i<n; i++) {
var p:MovieClip = this.points["p"+String(i)];
var distance:Number = dist(this._xmouse, this._ymouse, p._x, p._y);
if (distance<1000) {
var a:Number = -Math.atan2(this._ymouse-p._y, this._xmouse-p._x)+Math.PI/2;
var s:Number = Math.sin(a);
var c:Number = Math.cos(a);
var w:Number = distance/100;
p._x += s/w;
p._y += c/w;
}
}
};
function dist(x1:Number, y1:Number, x2:Number, y2:Number):Number {
var dx:Number = x1-x2;
var dy:Number = y1-y2;
return Math.sqrt(dx*dx+dy*dy);
}

Comments


love 1 1 joy 1 1 wow 0 0 mad 0 0 sad 0 0 fear 0 0 neutral 0 0
:iconstachuuu:
Awwwwww how sweet :*******

--
Life is a pain which can't be eased...
THE ROOMZ
:iconpromenada:
juz wiem co bede robić gdy sie bede nudzic :D

--
don't think too much!
:iconkatara-izme:
yaaay! i like it 'coz it's like i'm vaccuming a whole galaxy of multicoloured stars!
:iconaniolek19:
boskie :D poprawia humor :D

--
(\__/)
(+'.'+)
(")_(")
:iconralfi:
dziękuję, ale nie polecam :)

--
:butterflytwo:
:iconralfi:
I'm glad you like it :P
thank you :)

--
:butterflytwo:
:iconralfi:
cieszę się, dziękuję :)

--
:butterflytwo:
:icon1234spider:
ale zajebiaszcze :)

--
My mind always burn >:)
Watch my :gallery: [link]

Details

March 28
560 bytes
6.0 KB
100×100

Statistics

12
6 [who?]
142 (0 today)
1 (0 today)

Share

Link
Embed
Thumb

Site Map