Author Archives: Zevan

Command Draw Source

CLICK HERE TO COPY
Actionscript:

[SWF(width = 600, height = 500, frameRate=30, background = 0xFFFFFF)]

 

var cmd:String = "1000 small orange circles, 9000 black lines,3 large white circles"

// try some of these commands:

//"300 small red triangles and 2 big orange circle 3 big black lines";

//"100 big black triangles, ten small white rectangles 1 big white circle and 1 [...]

Posted in Graphics, dynamic, strings | Tagged , | 3 Comments

QuickBox2D Chain

CLICK HERE TO COPY
Actionscript:

import com.actionsnippet.qbox.*;

 

var sim:QuickBox2D = new QuickBox2D(this, {debug:true});

// use the box2D default renderer (debug : true)

 

sim.createStageWalls();

 

// anchor

var pre:QuickObject = sim.addCircle({x:9, y:3, radius:.5, density:0});

 

// create a chain of boxes

for (var i:int = 0; i<12; i++){

  var curr:QuickObject = sim.addBox({x:10 + i, y:3, width:.9, height:.9, angularDamping:1});

                    [...]

Posted in Box2D, QuickBox2D, motion | Tagged , , , | 4 Comments

Quick Box2D

CLICK HERE TO COPY
Actionscript:

[SWF(backgroundColor = 0x333333)]

 

import com.actionsnippet.qbox.*;

 

// setting debug = true, will use the Box2D debug rendering

var sim:QuickBox2D=new QuickBox2D(this, {debug:false, gravityY:10});

 

// creates static boxes on all sides of the screen

sim.createStageWalls({lineAlpha:0, fillColor:0xFF9900});

 

// add 25 boxes

for (var i:int = 0; i<25; i++){

    var xp:Number = 3 + (i % 5);

    var yp:Number = 1 + [...]

Posted in QuickBox2D, motion | Tagged , | 13 Comments

Random Equation Attractor

CLICK HERE TO COPY
Actionscript:

[SWF(width = 800, height = 800)]

var a:Number = 0.19;

var b:Number = .9;

var c:Number = 1.3

var xn1:Number = 5;

var yn1:Number = 0;

var xn:Number, yn:Number;

 

var scale:Number =40;

var iterations:Number = 20000;

 

function f(x:Number):Number{

    // too lazy to simplify this at the moment

    return((x + .1 + x * (a - c) * x) / [...]

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