Author Archives: Zevan

QuickBox2D create() Method

CLICK HERE TO COPY
Actionscript:

import com.actionsnippet.qbox.*;

import Box2D.Common.Math.*;

import Box2D.Collision.Shapes.*;

 

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

 

var sim:QuickBox2D = new QuickBox2D(this);

 

sim.setDefault({fillColor:0x990000, lineColor:0xFFCC00});

sim.createStageWalls();

 

var shapeTypes:Array = ["circle", "box", "poly"];

var pnts:Array = [-1, 0, -0.5, -1, 0.5, -1, 1, 0, 0,0.5, -1, 0];

var poly:Array=[];

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

    var xp:Number = 3 + Math.random()*15;

    var [...]

Posted in Box2D, QuickBox2D | Tagged , , , | 1 Comment

QuickBox2D groupIndex Platforms

CLICK HERE TO COPY
Actionscript:

import com.actionsnippet.qbox.*;

import Box2D.Common.Math.*;

import Box2D.Collision.Shapes.*;

 

[SWF(width = 800, height = 600, backgroundColor = 0x000000)]

 

var sim:QuickBox2D = new QuickBox2D(this);

 

sim.createStageWalls();

 

var boxNum:int = 8;

var boxes:Array = [];

var xp:Number, yp:Number, w:Number;

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

    xp = 3 + Math.random() * 10;

    yp = 4 + i * 2;

    w = 2 + [...]

Posted in Box2D, QuickBox2D | Tagged , , , , | 10 Comments

Fake Light w/ UV & Quads

CLICK HERE TO COPY
Actionscript:

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

x = stage.stageWidth / 2;

y = stage.stageHeight / 2;

var quadNum:int = 2200;

// standard Vectors for using drawTriangles

var verts:Vector.<Number> = new Vector.<Number>();

var pVerts:Vector.<Number>;

var uvts:Vector.<Number> = new Vector.<Number>();

var indices:Vector.<int> = new Vector.<int>();

// needed for z-sorting

var sortedIndices:Vector.<int>;

var faces:Array = [];

// we'll use this for tranforming points

// and as the [...]

Posted in 3D, Graphics, Vector, matrix, misc, sortOn | Tagged , , , | 2 Comments

More z-sorting

CLICK HERE TO COPY
Actionscript:

[SWF(width = 500, height=500, backgroundColor = 0x333333)]

x = stage.stageWidth / 2;

y = stage.stageHeight / 2;

 

 

var polyNum:int = 3000;

// standard Vectors for using drawTriangles

var verts:Vector.<Number> = new Vector.<Number>();

var pVerts:Vector.<Number>;

var uvts:Vector.<Number> = new Vector.<Number>();

var indices:Vector.<int> = new Vector.<int>();

// needed for z-sorting

var sortedIndices:Vector.<int>;

var faces:Array = [];

 

// we'll use this for tranforming points

// and as the [...]

Posted in 3D, Graphics, Vector, matrix, misc | Tagged , , , , | 6 Comments