This is a demo of the throwableItem Class. Click, drag & throw.
The throwableItem engine only has 175 lines of code!
It it easy to use and it’s for free. Open source for a better world.
Feel free to download it here.
/* IMPORT THROWING ENGINE: */
import com.thirtyOne.prototypes.physics.throwableItem;
var throwEngine:throwableItem;
for (var i:uint=0; i<20; i++) {
/* CREATE A THROWABLE ITEM: */
var YOUR_CONTAINER:Sprite = new Sprite();
var randomScale:Number = Math.random()*1+.5;
YOUR_CONTAINER.scaleX = randomScale;
YOUR_CONTAINER.scaleY = randomScale;
YOUR_CONTAINER.graphics.lineStyle(1, 0xFFFFFF);
YOUR_CONTAINER.graphics.beginFill(0x000000);
YOUR_CONTAINER.graphics.drawCircle(0, 0, 75);
YOUR_CONTAINER.graphics.endFill();
/* ASSIGN ITEM TO throwableItem CLASS: */
/* throwEngine.throwableItem(STAGE:Stage, FORCE:Number, DEBUG:Boolean) */
/* throwEngine.create(CONTAINER:*, X:Number, Y:Number):Sprite */
throwEngine=new throwableItem(stage,4,false);
stage.addChild(throwEngine.create(YOUR_CONTAINER, Math.random()*stage.stageWidth,Math.random()*stage.stageHeight));
}







