From 79670053c7247d3a49b607960efd284e93f057e5 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 2 Aug 2013 17:14:26 -0500 Subject: install.pl --- bPod/com/player/Visuals.as | 85 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 bPod/com/player/Visuals.as (limited to 'bPod/com/player/Visuals.as') diff --git a/bPod/com/player/Visuals.as b/bPod/com/player/Visuals.as new file mode 100644 index 0000000..2a4ac7b --- /dev/null +++ b/bPod/com/player/Visuals.as @@ -0,0 +1,85 @@ + + +class com.player.Visuals extends MovieClip { + +// private var theRoot:MovieClip; + private var numParticles:Number = 10; + private var minDist:Number = 50; + private var springAmount:Number = .001; + + private var vbounds:MovieClip; + + public function Visuals() {} + + public function init():Void + { + setMask (vbounds); + + for(var i:Number=0; i< numParticles;i++) { + var particle:MovieClip = this.attachMovie("particle", "p" + i, i); + particle._x = Math.random() * vbounds._width; + particle._y = Math.random() * vbounds._height; + particle.vx = Math.random() * 6 - 3; + particle.vy = Math.random() * 6 - 3; + particle._xscale = particle._yscale = 10 + Math.random() * 100; + particle.mass = particle._xscale / 100; + } + +// onEnterFrame = initAnimation; + + + } + + private function onEnterFrame():Void + { + for(var i:Number = 0;i vbounds._width) { + particle._x = vbounds._x; + } + else if(particle._x < -10) { + particle._x = vbounds._width; + } + if(particle._y > vbounds._height) { + particle._y = vbounds._y; + } + else if(particle._y < -46) { + particle._y = vbounds._height; + } + } + + clear(); + for(i=0;i