Author Archives: Zevan

Zeno’s [classic easeOut]

CLICK HERE TO COPY
Actionscript:

stage.frameRate = 30;

var circle:Shape = Shape(addChild(new Shape()));

with(circle.graphics) beginFill(0x000000), drawCircle(0,0,10);

circle.y = 50;

 

addEventListener(Event.ENTER_FRAME, onLoop);

function onLoop(evt:Event):void {

    circle.x += (mouseX - circle.x) / 12;

}

Posted in motion, one-liners | Tagged , | Leave a comment

Point.polar() Stars

CLICK HERE TO COPY
Actionscript:

[SWF(width=700, height=400, backgroundColor=0x000000, frameRate=30)]

 

var points:Array = new Array();

var index:int = -1;

function polar(thetaInc:Number, radius:Number):Point{

    index++;

    if (!points[index]) points[index] = 0;

    return Point.polar(radius, points[index] += thetaInc)

}

///////////////////////////////////////////////////

// test it out:

 

var canvas:BitmapData = new BitmapData(700, 400, false, 0xFFFFFF);

 

addChild(new Bitmap(canvas, "auto", true));

 

var p0:Point = new Point(200, 200);

var p1:Point = new Point(500, 200);

 

addEventListener(Event.ENTER_FRAME, onLoop);

function onLoop(evt:Event):void [...]

Posted in BitmapData, motion, setPixel | Tagged , | Leave a comment

Playing with Curves Point.polar()

CLICK HERE TO COPY
Actionscript:

[SWF(width=600, height=500, backgroundColor=0x000000, frameRate=30)]

var points:Array = new Array();

var index:int = -1;

function polar(thetaInc:Number, radius:Number):Point{

    index++;

    if (!points[index]) points[index] = 0;

    return Point.polar(radius, points[index] += thetaInc);

}

///////////////////////////////////////////////////

// test it out:

 

var canvas:BitmapData = new BitmapData(600, 500, false, 0xFFFFFF);

 

addChild(new Bitmap(canvas, "auto", true));

 

var p0:Point = new Point(80, 100);

var p1:Point = new Point(270, 100);

var p2:Point = [...]

Posted in motion, setPixel | Tagged , | Leave a comment

Game of Life Snippets

SNIPPET ONE
SNIPPET TWO
I was very impressed when I saw Mario Klingemann's game of line in 3 lines of code blog post late last year. I've been meaning to post about it for awhile - finally got around to it.
Mario Klingemann is the developer of Peacock... an excellent node based image generator written in ActionScript.
BitmapData.paletteMap() is [...]

Posted in BitmapData, misc, pixel manipulation | Tagged , | Leave a comment