HOME | DD

ArtBIT — writtenInMagic by-sa

Published: 2006-11-24 05:28:42 +0000 UTC; Views: 9656; Favourites: 112; Downloads: 339
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

chisa3 [2012-06-29 16:24:07 +0000 UTC]

this was awesome! i loved it i can play this for hours and hours

👍: 0 ⏩: 0

scorpiob [2009-08-31 06:20:35 +0000 UTC]

Awesome!

👍: 0 ⏩: 0

dark-dragon-wings [2007-06-28 07:37:15 +0000 UTC]

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 : )

👍: 0 ⏩: 0

Jellomix [2007-06-14 01:24:32 +0000 UTC]

Wah, so small but so very amusing.
I love the graceful touch to it.

👍: 0 ⏩: 0

BlackVine [2007-06-12 12:37:35 +0000 UTC]

Woah. As you said, hypnotic....

👍: 0 ⏩: 0

falarae [2007-06-12 07:53:38 +0000 UTC]

wow...this is so awesome...and it's great of you to put the code up, too...

did you make this using Macromedia Flash?

👍: 0 ⏩: 1

ArtBIT In reply to falarae [2007-06-12 14:13:18 +0000 UTC]

aye...

👍: 0 ⏩: 0

swerno092 [2007-03-17 11:11:18 +0000 UTC]

I still cant get over how awesome this is . . .

👍: 0 ⏩: 1

ArtBIT In reply to swerno092 [2007-03-17 12:51:28 +0000 UTC]

It's not that awesome... just a little line experiment...

👍: 0 ⏩: 1

swerno092 In reply to ArtBIT [2007-03-18 07:15:32 +0000 UTC]

Erm mister arbit, can you tell me the speciefic types of action scripts you used , i realy dont have a clue . . .

👍: 0 ⏩: 1

ArtBIT In reply to swerno092 [2007-03-18 13:34:00 +0000 UTC]

Just an array of points with some velocities applied, and connected with lines...

👍: 0 ⏩: 1

swerno092 In reply to ArtBIT [2007-03-18 13:34:34 +0000 UTC]

0.o okay erm thanks . .

👍: 0 ⏩: 1

ArtBIT In reply to swerno092 [2007-03-18 14:05:37 +0000 UTC]

Check the description of the file, I've added the basic code....

👍: 0 ⏩: 0

swerno092 [2007-02-23 23:30:51 +0000 UTC]

Erm howd u make this? What speciefic action scripts should i use in order to make somehting like this?

👍: 0 ⏩: 1

ArtBIT In reply to swerno092 [2007-02-24 00:35:41 +0000 UTC]

Heh, specific? Learn the basics, then ,experiment dude.
This is just an array of points, with some low gravity physics applied, and then just I draw lines between the points.

Learn arrays. They're pretty basic, yet so ultimately useful.

👍: 0 ⏩: 1

swerno092 In reply to ArtBIT [2007-02-24 00:39:12 +0000 UTC]

Ok thanks, but how do u apply the physiscs theories? What action scripts do i have to use?

👍: 0 ⏩: 1

ArtBIT In reply to swerno092 [2007-02-24 01:06:16 +0000 UTC]

You must learn to code. Not copy'n'paste the scripts...
You must learn the basics (variables, basic classes, arrays, loops, etc.), then ask for help if there's something you don't understand. You cannot just ask someone "How can I make this?"
Someone even asked me if I could do a short tutorial how to do something like my game The Atonement ... I mean come on. There's over 6000 lines of code. People ask me about 5-6 lines of code and I spend 30mins explaining them how that works... I'd need to write a book to explain how to make something like that, and only the code - not everything needed for the game...
I would still need more books to write so that I could explain physics, collisions, math underneath all that.

You should learn how something works and then use it.

I gave you the links, go and learn mate. If you have any questions, jump to flashers chat...

Cheers

👍: 0 ⏩: 1

swerno092 In reply to ArtBIT [2007-02-24 02:43:25 +0000 UTC]

Woah 6000 lines of codes now thats like oh dman thats so hard you must be somekinds genius dude

👍: 0 ⏩: 1

ArtBIT In reply to swerno092 [2007-02-24 02:59:04 +0000 UTC]

No I'm not. That's not much. You'll see...

👍: 0 ⏩: 0

FurryFoxCoon [2007-02-11 21:42:58 +0000 UTC]

Hé hé !
Nice work !
It can be also a great screensaver

👍: 0 ⏩: 0

ktgodstgarden [2007-02-08 09:56:53 +0000 UTC]

Pure amazement! I played with it for hours, and I wasn't on any drugs (other than nicotine and caffeine)

👍: 0 ⏩: 1

ArtBIT In reply to ktgodstgarden [2007-02-08 14:41:06 +0000 UTC]

Hey, hey, hey! Dude!
Long time no read! How have you been?
I hope you're doing ok...

Thanks for the visit mate... good to see you again!

👍: 0 ⏩: 1

ktgodstgarden In reply to ArtBIT [2007-02-08 15:37:30 +0000 UTC]

Yeah, I'm doing okay. I'm trying to find a job because my mother left state without me, and I don't want to keep being financal burden on my friends. Other than that, it's pretty much the same. How 'bout you?

👍: 0 ⏩: 1

ArtBIT In reply to ktgodstgarden [2007-02-08 16:30:20 +0000 UTC]

Damn it dude!? She left the country? Without you?!
Trying to find my place in the world, and trying to make some money...

Can I do anything to help?

👍: 0 ⏩: 1

ktgodstgarden In reply to ArtBIT [2007-02-08 16:33:04 +0000 UTC]

Ummm, Keep creating awesome stuff! haha! (And in the US, there are several states. She's still in the country) but I don't know where or why she left. She called a couple of my friends, but that is it. Oh well, I'm 18, and legally an adult, so I just gotta grow up and support myself now. Haha! Don't worry, I'll be okay!

👍: 0 ⏩: 1

ArtBIT In reply to ktgodstgarden [2007-02-08 16:57:23 +0000 UTC]

He, he... dude, I will try. Glad to see you have some positive energy in you.
Hang in there!

👍: 0 ⏩: 1

ktgodstgarden In reply to ArtBIT [2007-02-08 17:53:15 +0000 UTC]

Yeah, I believe that mood is an energy that can not only improve it's user, but make better the lives of those around them. If everyone thinks positively, then the world is a great place. Not that it it's not okay to express negative emotions, that is fine too. One should just keep an open mind, and a constructive out look, searching for a solution to their problems, rather than let the problem become a permeated source of continuing negativity, which in and of it's self becomes more problems. Wow, I should go back to high school, then go get my psyche degree at college. I love this stuff! lol

👍: 0 ⏩: 1

ArtBIT In reply to ktgodstgarden [2007-02-08 18:00:49 +0000 UTC]

lol I totally agree. Not that I'm being insanely optimistic, but life's short and I don't want to waste it on being down...
I try looking on the bright side of life cuz
"...life's a piece of shit, when you look at it
Life's a laugh and death's a joke it's true,
You'll see it's all a show,
Keep 'em laughing as you go,
Remember that the last laugh is on you...
aaaaaaand...."

👍: 0 ⏩: 1

ktgodstgarden In reply to ArtBIT [2007-02-08 18:12:31 +0000 UTC]

Yeah, I know what you mean. I have my despairing moments, but I try to keep positive! I go get Government aid today, Which is good! YaY!

👍: 0 ⏩: 1

ArtBIT In reply to ktgodstgarden [2007-02-08 19:19:55 +0000 UTC]

He, he, he, kudos!

👍: 0 ⏩: 1

ktgodstgarden In reply to ArtBIT [2007-02-08 20:54:34 +0000 UTC]

Yup! I'm officially ghetto today! lol

👍: 0 ⏩: 0

Great-5 [2007-02-07 04:33:32 +0000 UTC]

wow this is sooo cool!

👍: 0 ⏩: 1

ArtBIT In reply to Great-5 [2007-02-07 05:37:19 +0000 UTC]

heh thanks

👍: 0 ⏩: 0

sweet-Mei [2007-02-04 11:42:41 +0000 UTC]

Amazing!

👍: 0 ⏩: 1

ArtBIT In reply to sweet-Mei [2007-02-04 14:06:03 +0000 UTC]

Interesting - yes, but amazing... I wouldn't go that far

👍: 0 ⏩: 0

gryffenclaw [2007-01-26 06:14:13 +0000 UTC]

Wow... This is amazing! How do you make things like this? I would like to try and make interactive art programs too... Do you download or buy a flash program?






~~gryffenclaw

👍: 0 ⏩: 1

ArtBIT In reply to gryffenclaw [2007-01-26 11:09:38 +0000 UTC]

You could download a Flash 8 30 day trial version, but since this is 100% actionscript, you could use flashDevelop (a free GPL Flash IDE -> [link] )
It is much much better than the Macromedia's IDE ( for actionScript that is )
It compiles more quickly, it has code hints, code folding, and more, but what is the most important - it's free

👍: 0 ⏩: 1

gryffenclaw In reply to ArtBIT [2007-01-26 16:05:16 +0000 UTC]

Ooooohhh... Free... Cool, thanks so much! By the way, I'm using a Mac, would this be a problem with flash?









~~gryffenclaw

👍: 0 ⏩: 1

ArtBIT In reply to gryffenclaw [2007-01-26 16:34:01 +0000 UTC]

I don't think so. Flash is platformIndependent, browserIndependent, osIndependent. Mac/PC - Mozilla/IE/Opera - OSX/Windows/Linux - you name it, all you need is a flashPlugin.

Cheers.

👍: 0 ⏩: 1

gryffenclaw In reply to ArtBIT [2007-01-26 17:13:04 +0000 UTC]

Sweet! Thanks!









~~gryffenclaw

👍: 0 ⏩: 0

branjinjica [2006-12-19 21:32:42 +0000 UTC]

Ne mogu da vjerujem. Ovo smiruje...ne mogu ti opisati koliko mi je drago sto te pronadjoh medju ovom gomilom..super je..super..

👍: 0 ⏩: 1

ArtBIT In reply to branjinjica [2006-12-19 21:45:47 +0000 UTC]

👍: 0 ⏩: 1

branjinjica In reply to ArtBIT [2006-12-19 21:51:27 +0000 UTC]

pazi da me ne ugusis

👍: 0 ⏩: 1

ArtBIT In reply to branjinjica [2006-12-19 21:53:00 +0000 UTC]

*daje joj slamcicu da moze da dise...*

👍: 0 ⏩: 1

branjinjica In reply to ArtBIT [2006-12-20 00:55:23 +0000 UTC]

ahahahahahhahaahahahahhaahahahahah))
Hvala

👍: 0 ⏩: 0

chameleonmind [2006-12-11 21:02:13 +0000 UTC]

Stvarno cool! Nisam znao da Flash može da proizvede ovakav blur...

👍: 0 ⏩: 1

ArtBIT In reply to chameleonmind [2006-12-12 10:41:33 +0000 UTC]

Da, da, i još štošta

👍: 0 ⏩: 0

Dina-n1 [2006-12-08 03:23:25 +0000 UTC]

awsome ..

bye bye ..

👍: 0 ⏩: 1

ArtBIT In reply to Dina-n1 [2006-12-08 07:25:48 +0000 UTC]

Thankies hon

👍: 0 ⏩: 1

Dina-n1 In reply to ArtBIT [2006-12-08 11:05:39 +0000 UTC]

u're welcome dear

👍: 0 ⏩: 0


| Next =>