Author Archives: Zevan

QuickBox2D Skinning Examples

I've been trying to finalize the way QuickBox2D skinning works... so that its flexible and so that I only add to the api rather than modifying it. So this post really has two main purposes... the first is to show you lots of skinning examples from complex to simple - and the second is to [...]

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

QuickBox2D Contact Filtering

CLICK HERE TO COPY
Actionscript:

import com.actionsnippet.qbox.*;

import Box2D.Dynamics.*;

import Box2D.Collision.Shapes.*;

 

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

 

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

 

var box:QuickObject = sim.addBox({x:12, y:16, width:3, height:3, density:0 , groupIndex:-1});

var circle:QuickObject = sim.addCircle({x:5, y:3, radius:0.5, groupIndex:-1});

 

// add another box to show that Box2D is still working

var littleBox:QuickObject = sim.addBox({x:12, y:3, width:1, height:1});

 

sim.createStageWalls();

 

sim.start();

sim.mouseDrag();

 

var filter:b2ContactFilter = new [...]

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

Seamless Vector Texture

CLICK HERE TO COPY
Actionscript:

[SWF(width = 800, height = 450, backgroundColor=0xFFFFFF)]

 

graphics.beginFill(0xDEDEDE);

graphics.drawRect(0,0,400,400);

 

var container:Sprite = Sprite(addChild(new Sprite()));

draggable(rx(), ry(), 0x112233, 20);

draggable(rx(), ry(), 0x2266FF, 15);

draggable(rx(), ry(), 0x003299, 50, "rect");

draggable(rx(), ry(), 0xFFFFFF, 30);

draggable(rx(), ry(), 0x00CCFF, 15);

draggable(rx(), ry(), 0x1188CC, 50, "rect");

 

function rx():Number{

    return Math.random() * 200 + 100;

}

function ry():Number{

    return Math.random() * 200 + 100;

}

 

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

with(guides.graphics){

    [...]

Posted in BitmapData, Graphics, misc | Tagged , , | 4 Comments

QuickBox2D 3D

CLICK HERE TO COPY
Actionscript:

import com.actionsnippet.qbox.*;

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

 

var main:MovieClip = MovieClip(addChild(new MovieClip()));

main.z = 500;

main.rotationX = -40;

 

var sim:QuickBox2D = new QuickBox2D(main);

 

sim.createStageWalls({fillColor:0x1133CC});

sim.setDefault({lineColor:0xFFFFFF, fillColor:0x113355});

 

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

    var b:QuickObject = sim.addBox({x:Math.random()*10 + 3, y:Math.random()*10 + 3,

                            [...]

Posted in 3D, Box2D, QuickBox2D | Tagged , , , , , | 2 Comments