Shop Mobile More Submit  Join Login
×




Details

Submitted on
November 23, 2006
Image Size
4.3 KB
Resolution
550×400
Thumb

Stats

Views
7,238
Favourites
116 (who?)
Comments
125
Downloads
311

License

Creative Commons License
Some rights reserved. This work is licensed under a
Creative Commons Attribution-Share Alike 3.0 License.
×
-NEEDS FLASH 8 OR HIGHER-

Just a small experiment, that ended up quite hypnotic...

[MouseClick] - toggles blur
[LEFT, RIGHT, UP, DOWN] - controls gravity
[SPACE] - turns off gravity
[1] - snake mode
[2] - lines mode

Trip.

Peace.

***Check out the variation inspired by this work (which is even better imo) -> [link]

[EDIT March, 18. 2007.]
Since several people asked me about the code behind this, here's the basic engine for you to experiment with:

var numPoints = 20;
var speed = 10;
var stageWidth = 550;
var stageHeight = 400;
var points:Array = generateArrayOfPoints(numPoints);

function generateArrayOfPoints(num:Number):Array {
  var arr:Array = new Array();
  for(var i=0; i<num; i++) {
    // create a new object and place it in the array
    // Objects has 4 properties: (x, y) - position vector, (vx, vy) - velocity vector
    arr.push(new Object( {x:Math.random()*stageWidth, y:Math.random()*stageHeight, vx: (Math.random()-0.5)*speed, vy: (Math.random()-0.5)*speed} ));
  }
  return arr;
}

function movePoints(arr:Array) {
  var len = arr.length;
  for(var i=0; i<len; i++) {
    var p = arr[i];
    p.x += p.vx;
   
    //check for if it left the screen   
    if( p.x>stageWidth || p.x<0 ) {
      //reverse the x velocity
      p.vx*=-1;
      p.x += p.vx;
    }
   
    p.y += p.vy;
   
    if( p.y>stageHeight || p.y<0 ) {
      //reverse the y velocity
      p.vy*=-1;
      p.y += p.vy;
    } 
   
  }
}

function plotPoints(mc:MovieClip, arr:Array) {
  mc.lineStyle(2,0xaaaaaa,100);
  var len = arr.length;
  //position the pen on our first point in the array
  mc.moveTo(arr[0].x,arr[0].y);
  //cycle through our points array
  for(var i=0; i<len; i++) {
    //plot a line to the current point
    mc.lineTo(arr[i].x,arr[i].y);
  }
}

onEnterFrame = function() {
  //clear the canvas
  this.clear();
  //calculate new positions for our array
  movePoints(points);
  //plot the lines
  plotPoints(this,points);
}
Add a Comment:
 
:iconchisa3:
chisa3 Featured By Owner Jun 29, 2012  Student Artist
this was awesome! i loved it i can play this for hours and hours
Reply
:iconscorpiob:
scorpiob Featured By Owner Aug 30, 2009
Awesome!
Reply
:icondark-dragon-wings:
dark-dragon-wings Featured By Owner Jun 28, 2007
so amusing....... *insert dribble* i love it !!!!!!!!!!

ITS ATHLINIA'S birthday.... please just stop by her DA and say hello..... its gunna be my present to her :) I wouldn’t mind either if you copied and pasted this message everywhere to please : )
Reply
:iconjellomix:
Jellomix Featured By Owner Jun 13, 2007
Wah, so small but so very amusing. :+fav:
I love the graceful touch to it.
Reply
:iconblackvine:
BlackVine Featured By Owner Jun 12, 2007
Woah. As you said, hypnotic....
Reply
:iconfalarae:
falarae Featured By Owner Jun 12, 2007  Hobbyist Digital Artist
wow...this is so awesome...and it's great of you to put the code up, too...

did you make this using Macromedia Flash?
Reply
:iconartbit:
ArtBIT Featured By Owner Jun 12, 2007  Hobbyist Digital Artist
aye...
Reply
:iconswerno092:
swerno092 Featured By Owner Mar 17, 2007
I still cant get over how awesome this is . . .
Reply
:iconartbit:
ArtBIT Featured By Owner Mar 17, 2007  Hobbyist Digital Artist
It's not that awesome... just a little line experiment...
Reply
:iconswerno092:
swerno092 Featured By Owner Mar 18, 2007
Erm mister arbit, can you tell me the speciefic types of action scripts you used , i realy dont have a clue . . .
Reply
Add a Comment: