HOME | DD

ArtBIT — writtenInMagic by-sa

Published: 2006-11-24 05:28:42 +0000 UTC; Views: 9723; Favourites: 112; Downloads: 341
Redirect to original
Description -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     // 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     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     //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);
}
Related content
Comments: 126

Nattregn [2006-12-04 22:56:43 +0000 UTC]

Quite fancy, I must say! You never fail to amuse me

👍: 0 ⏩: 1

ArtBIT In reply to Nattregn [2006-12-04 23:09:14 +0000 UTC]

Thanks hon

👍: 0 ⏩: 0

Mizra [2006-12-04 04:46:05 +0000 UTC]

Again with the wonderful, awesome work on Flash. Every time I see a new work from you, I am amazed at the skill and creativity that goes into each animation or game.

👍: 0 ⏩: 1

ArtBIT In reply to Mizra [2006-12-04 07:09:49 +0000 UTC]

Thank you hon, but these are all just "sketches", I don't finish anything that I s...

👍: 0 ⏩: 1

Mizra In reply to ArtBIT [2006-12-04 13:53:02 +0000 UTC]


You, too? I've been told that I have the mindset of a..
LOOK! Pretty butterfly!!!! *points and watches in earnest*

👍: 0 ⏩: 1

ArtBIT In reply to Mizra [2006-12-04 16:31:29 +0000 UTC]

👍: 0 ⏩: 0

f081a In reply to ??? [2006-12-02 10:53:08 +0000 UTC]

That's so rocking... nice fav

👍: 0 ⏩: 0

naruto017 [2006-12-02 09:08:55 +0000 UTC]

Thats pretty cool looks like some thing from this stit [link] check it out sometime (>_(<

👍: 0 ⏩: 1

ArtBIT In reply to naruto017 [2006-12-02 17:28:33 +0000 UTC]

damn... all those games are like 3-5Mb...
That's quite a task for my dialUp...

...but the thumbnails look interesting though...

👍: 0 ⏩: 1

naruto017 In reply to ArtBIT [2006-12-05 03:26:06 +0000 UTC]

o thats too bad

👍: 0 ⏩: 0

JaapvdV In reply to ??? [2006-11-30 20:51:15 +0000 UTC]

Cool! ^-^

👍: 0 ⏩: 0

Formor In reply to ??? [2006-11-27 16:18:25 +0000 UTC]

Very, very, very ... cool

I played with it for about 30 minutes...

👍: 0 ⏩: 1

ArtBIT In reply to Formor [2006-11-27 18:09:07 +0000 UTC]

lol thanks Adam

👍: 0 ⏩: 1

Formor In reply to ArtBIT [2006-11-27 22:09:57 +0000 UTC]

👍: 0 ⏩: 0

GoranCaBuhOcTojuh In reply to ??? [2006-11-26 11:11:56 +0000 UTC]

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa
THIS IS SO FUCKING PHENOMENAL ! ! ! ! !
Way 2 go!

👍: 0 ⏩: 1

ArtBIT In reply to GoranCaBuhOcTojuh [2006-11-26 16:30:49 +0000 UTC]

XD

👍: 0 ⏩: 0

Mutantwombat In reply to ??? [2006-11-25 20:02:36 +0000 UTC]

really cool

👍: 0 ⏩: 0

Fashingirl In reply to ??? [2006-11-25 15:09:29 +0000 UTC]

wicked!!!!!!!!!1

👍: 0 ⏩: 1

ArtBIT In reply to Fashingirl [2006-11-26 16:58:42 +0000 UTC]

Thankies Joana

👍: 0 ⏩: 0

Marchudichu [2006-11-25 02:38:55 +0000 UTC]

Holly hell. Completly awesome. Amazing math knowledge. How much time did it take you?

👍: 0 ⏩: 1

ArtBIT In reply to Marchudichu [2006-11-26 16:55:33 +0000 UTC]

Thanks, but it was not complicated at all, no advanced math knowledge also, and it took me about half an hour to do...

👍: 0 ⏩: 1

Marchudichu In reply to ArtBIT [2006-11-28 02:28:48 +0000 UTC]

>: | lol. Well, congrats.

👍: 0 ⏩: 1

ArtBIT In reply to Marchudichu [2006-11-28 16:38:57 +0000 UTC]

lol thanks

👍: 0 ⏩: 0

lexus727 In reply to ??? [2006-11-25 02:11:47 +0000 UTC]

incredible man, ur teaching me that next

👍: 0 ⏩: 1

ArtBIT In reply to lexus727 [2006-11-25 20:10:00 +0000 UTC]

lol k

👍: 0 ⏩: 0

LOTReHPlp In reply to ??? [2006-11-24 23:49:01 +0000 UTC]

ooooooo!

lol, you've just given me entertainment for the next day!!! hahahaha

👍: 0 ⏩: 1

ArtBIT In reply to LOTReHPlp [2006-11-27 00:11:32 +0000 UTC]

👍: 0 ⏩: 0

MilankaTakitak In reply to ??? [2006-11-24 20:42:59 +0000 UTC]

I simply just love all your work, man!
So f***ing great!
DUDE! 8D

👍: 0 ⏩: 1

ArtBIT In reply to MilankaTakitak [2006-11-26 16:34:03 +0000 UTC]



👍: 0 ⏩: 0

Krum-Strashni In reply to ??? [2006-11-24 18:51:48 +0000 UTC]

so cool!

👍: 0 ⏩: 1

ArtBIT In reply to Krum-Strashni [2006-11-27 00:25:01 +0000 UTC]

I'm glad you think so neighbor

👍: 0 ⏩: 0

Eredor [2006-11-24 17:44:35 +0000 UTC]

groovy!

👍: 0 ⏩: 1

ArtBIT In reply to Eredor [2006-11-26 16:37:43 +0000 UTC]

Earthworm Jim!

👍: 0 ⏩: 1

Eredor In reply to ArtBIT [2006-11-27 11:00:00 +0000 UTC]

wow...
i loved that game!

👍: 0 ⏩: 1

ArtBIT In reply to Eredor [2006-11-27 14:03:06 +0000 UTC]

Same here

👍: 0 ⏩: 0

fudging [2006-11-24 16:27:38 +0000 UTC]

Like a Windows Media Player visualisation, but interactive, and not quite the colour diversity. How easy would it be to add in eerie colour changes?

👍: 0 ⏩: 1

ArtBIT In reply to fudging [2006-11-26 16:40:05 +0000 UTC]

Not too hard I guess, two or three lines of code, but I've chosen to change the color depending in which corner you are...

👍: 0 ⏩: 1

fudging In reply to ArtBIT [2006-11-26 17:27:17 +0000 UTC]

Ah, hadn't noticed that happening before I thought it was just a mix between a small selection of colours.

👍: 0 ⏩: 0

butterpaw In reply to ??? [2006-11-24 15:37:22 +0000 UTC]

Ohh, thank you .. how cool ^_^

👍: 0 ⏩: 1

ArtBIT In reply to butterpaw [2006-11-26 16:46:54 +0000 UTC]

👍: 0 ⏩: 0

Jakesword [2006-11-24 15:03:45 +0000 UTC]

nice and tripy, just the way t ogo at 2am ^_^

👍: 0 ⏩: 1

ArtBIT In reply to Jakesword [2006-11-26 16:40:51 +0000 UTC]



👍: 0 ⏩: 1

Jakesword In reply to ArtBIT [2006-11-27 10:56:05 +0000 UTC]

lol xD

👍: 0 ⏩: 0

Lemming-Dragon In reply to ??? [2006-11-24 12:41:23 +0000 UTC]

wow dat is awesome!

👍: 0 ⏩: 1

ArtBIT In reply to Lemming-Dragon [2006-11-26 16:51:40 +0000 UTC]

Thanks mate

👍: 0 ⏩: 0

wonderwhy-ER [2006-11-24 12:31:14 +0000 UTC]

Heh. Cool. I will try to remake it witm my bazier engine. Looks similar to my aerodinamic cursor Need to try it with bazier. Look like smoke if lines are small. I will try to remake it with baziers. MAy be it will look better then

👍: 0 ⏩: 1

ArtBIT In reply to wonderwhy-ER [2006-11-24 12:40:17 +0000 UTC]

It prolly will look better with curves, but it will make it quite slower also...

👍: 0 ⏩: 3

wonderwhy-ER In reply to ArtBIT [2006-11-24 18:16:46 +0000 UTC]

[link]

👍: 0 ⏩: 0

wonderwhy-ER In reply to ArtBIT [2006-11-24 18:16:24 +0000 UTC]

Here i've finished it. Yors look better tought. Do you use blur?

👍: 0 ⏩: 1

ArtBIT In reply to wonderwhy-ER [2006-11-25 20:18:45 +0000 UTC]

Wow, looks pretty sweet, and thanks for the linkBack (*/me does the same)
Yes, I used Blur ([MouseClick] - toggles it)...

Cheers.

👍: 0 ⏩: 1


| Next =>