Star

Made a little star:

drawStar = function (aRadius, bRadius, CircleX, CircleY, clip, colour) {
var deltaAlpha = -Math.PI/5;
startX = CircleX+bRadius*Math.cos(deltaAlpha);
startY = CircleY-bRadius*Math.sin(deltaAlpha);
clip.beginFill(colour, 100);
clip.moveTo(startX, startY);
for (var i = 0; i<11; i=i+2) {
alpha = i*deltaAlpha;
a_x = CircleX+aRadius*Math.cos(alpha);
a_y = CircleY-aRadius*Math.sin(alpha);
clip.lineTo(a_x, a_y);
beta = (i+1)*deltaAlpha;
b_x = CircleX+bRadius*Math.cos(beta);
b_y = CircleY-bRadius*Math.sin(beta);
clip.lineTo(b_x, b_y);
}
clip.endFill();
};
myStars = createEmptyMovieClip("starClip", 1);
drawStar(90, 65, 0, 0, myStars, 0xFFCCFF);
drawStar(50, 25, 0, 0, myStars, 0xFF3399);
drawStar(25, 15, -5, -5, myStars, 0xFDB0FD);
myStars._x=150;
myStars._y=150;

Really wanted to be in the same room (or country!) as Pengie this afternoon so I could pester him about code. damn.

Comments are closed.

Powered by WordPress. Designed by Woo Themes