PDA

View Full Version : hypocycloidage



phorte
January 12th, 2006, 08:16 AM
Alrite, this is like the first competition ive ever entered, so lets see how we go. Got the idea from a school project i did a while ago on hypocycloids. So yeah, see how we go. j = 0
col = ["0x5A70A3","0xA3AFCB","0x374562","0x315E68","0x146485","0x06222D","0x6BC4E9","0xF8A298","0xFBDC95","0xE8E0A8","0xDFD6B0"]
drawShape(random(10)+5)
function drawShape(a) {
b = a*(random(10)+4)
var shape = _root.createEmptyMovieClip("shape"+j,j++)
shape._x = random(400)
shape._y = random(400)
i = 0
shape.lineStyle(random(2)+2, col[random(col.length)], 100);
shape.moveTo(b, 0);
shape.onEnterFrame = function() {
if (i<2*Math.PI) {
x = ((b-a)*Math.cos(i))+(a*Math.cos(((b/a)-1)*i));
y = ((b-a)*Math.sin(i))-(a*Math.sin(((b/a)-1)*i));
shape.lineTo(x, y);
i += Math.PI/90;
} else {
delete shape.onEnterFrame
drawShape(random(10)+5)
}
};
}
Thats like less than 25 lines? does that matter, might put some other random things in tomorrow. How many lines is that actually counted as?

[EDIT]Seeing as imports are now not allowed my new version is kaput.. :(

Comments greatly appreciated. :D

Low Lines
January 12th, 2006, 11:56 AM
Wow,
I just sat there watching it draw those shapes for several minutes!! I haven't looked at drawing things in actionscript much yet, but after seeing yours, it makes me want to.

Stratification
January 12th, 2006, 12:59 PM
Very nicely done, I like it!

salvador marley
January 12th, 2006, 02:15 PM
good work :)

I looked at the script and speeded it up to about double the drawing speed of the original and enjoyed it all the more. :)

kdd
January 12th, 2006, 03:21 PM
that is really cool. :thumb:

NiñoScript
January 12th, 2006, 05:46 PM
woah! really cool!!
pure maths!
:lol:

icio
January 12th, 2006, 08:23 PM
Awesome, that's really neat :)

unchew
January 12th, 2006, 08:32 PM
very nice!

freeskier89
January 13th, 2006, 01:12 AM
Sweet! Looks awesome :D. Kirupa isn't allowing the new flash 8 libraries to be used though (glow).
Love your footer also!

-freeskier89 :)

phorte
January 13th, 2006, 02:10 AM
Sweet! Looks awesome :D. Kirupa isn't allowing the new flash 8 libraries to be used though (glow).
Love your footer also!

-freeskier89 :)

ah... no fair... hmmm.. will get rid of that for the time being then, will have to think of another way to do it.

J
January 13th, 2006, 02:12 AM
Thats good.

But in your second entry you have used library classes :-/

hybrid101
January 13th, 2006, 10:08 AM
awesome! this is pretty cool man!