Actionscript:
-
stage.frameRate = 30;
-
-
for (var i:int = 0; i<100; i++){
-
makeBoxSegment(200, 200 - i, i * 2);
-
}
-
-
function makeBoxSegment(xp:Number, yp:Number, col:uint):Sprite {
-
var isoBox:Sprite = Sprite(addChild(new Sprite()));
-
with (isoBox) scaleY = .5, y = yp, x = xp;
-
var box:Shape = Shape(isoBox.addChild(new Shape()));
-
box.rotation = 45;
-
with (box.graphics) beginFill(col), drawRect(-50,-50,100,100);
-
isoBox.addEventListener(Event.ENTER_FRAME, onRotate);
-
return isoBox;
-
}
-
-
function onRotate(evt:Event):void {
-
evt.currentTarget.getChildAt(0).rotation = mouseX;
-
}
An isometric box that rotates with the mouseX.
2 Comments
why there is no “DRAWING”
your just supposed to copy and paste it on the timeline…. but I put this one on wonderfl:
http://wonderfl.net/code/b523b65bbe414a991ce5ed97caf2aa78e2fcd012