PDA

View Full Version : once again, im experimenting with random shapes and colors



mofongo9
March 25th, 2006, 03:43 PM
heres a code i made


i = 0;
for (amount=random(100)+1; amount>0; amount--) {
_root.createEmptyMovieClip("p"+i, i);
_root["p"+i]._x = random(550)+10;
_root["p"+i]._y = random(400)+10;
i++;
}
_root.createEmptyMovieClip("l", i+2);
_root.createEmptyMovieClip("bg", i+1);
rggb1 = random(100);
rggb2 = random(100);
rggb3 = random(100);
rggb = "0x"+rggb1+rggb2+rggb3;
bg.lineStyle(1, 0x000000, 0);
bg.beginFill(rggb, random(100));
bg.lineTo(Stage.width, 0);
bg.lineTo(Stage.width, Stage.height);
bg.lineTo(0, Stage.height);
bg.lineTo(0, 0);
bg.endFill();
l.moveTo(p0._x, p0._y);
while (i>0) {
thick = random(10)+1;
b = random(2);
alpha = random(40)+60;
rgb1 = random(100);
rgb2 = random(100);
rgb3 = random(100);
rgb = "0x"+rgb1+rgb2+rgb3;
l.lineStyle(thick, rgb, alpha);
if (b == 1) {
l.beginFill(rgb, alpha-10);
} else {
l.endFill();
}
l.lineTo(_root["p"+i]._x, _root["p"+i]._y);
i--;
}

generates random abstract thingy maboby i liked how it looked :-) some of you probably wont like it because its sorta stupid but i just like it cause it looks nice and i like basically everything made in purecode :D

swf:
http://img56.imageshack.us/my.php?image=apitest3fw.swf

Templarian
March 25th, 2006, 03:56 PM
mabey make it create crystal like structures and only use certain array of colors... becuase right now its kinda useless and serves no purpose (except random shapes).

mofongo9
March 25th, 2006, 03:58 PM
mabey make it create crystal like structures and only use certain array of colors... becuase right now its kinda useless and serves no purpose (except random shapes).
yea like i said its sorta pointless but i like how it looks thats why i like it :-)

evildrummer
March 29th, 2006, 06:43 AM
its pointlessly cool!