/*************************************************************** * * * 16/04/2007 - Isometric moving vehicle, '3d' trigo based - * * By Julien Wehrbach aka Zappan http://zappan.deviantart.com * * Use it freely, not for sale, please just quote me : * * Julien Wehrbach - Zappan - http://zappan.deviantart.com * * ask me for any question on zappan.net@gmail.com * * * * * * REMEMBER TO SET YOUR FPS TO 24 MINIMUM * * * ***************************************************************/ var deg:Number = 0; var rDeg:Number = 2; var dMov:Number = deg-70; var speed = 0; var maxSpeed = 15; c1 = _root.createEmptyMovieClip("car_mc", _root.getNextHighestDepth()); dots = new Array("uc1", "uc2", "uc3", "uc4", "uc5", "uc6", "uc7", "uc8", "uc9", "uc10", "uc11", "uc12", "uc13", "uc14", "uc15"); cx = new Array(0, 40, 180, 200, 220, 0, 40, 180, 200, 220, 0, 40, 180, 200, 220); cy = new Array(0, 40, 180, 200, 220, 0, 40, 180, 200, 220, 0, 40, 180, 200, 220); ellipse = new Array(60, 60, 60, 70, 60, 60, 60, 60, 70, 60, 60, 60, 60, 70, 60); Ydecal = new Array(0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 20, 20, 20, 20, 20); makePoints(c1, dots, cx, cy, ellipse, Ydecal, Stage.width/2, Stage.height/2); function makePoints(target:MovieClip, dots:Array, cx:Array, cy:Array, ellipse:Array, Ydecal:Array, initX:Number, initY:Number):Void { for (i=0; i0) ? 0.5 : 0; speed += (speed<0) ? 0.5 : 0; if (speed>2 || speed<-2) { if (Key.isDown(Key.LEFT)) { deg -= (deg>0) ? speed/rDeg : -360; } if (Key.isDown(Key.RIGHT)) { deg += (deg<360) ? speed/rDeg : -360; } } if (Key.isDown(Key.UP)) { speed += (speed-maxSpeed) ? 1 : 0; } this._x += vX; this._y += vY; tmp = this.createEmptyMovieClip("tmp", -1); tmp.lineStyle(1, 0x000000, 100); tmp.moveTo(this[dots[0]]._x+this[dots[0]]._width/2, this[dots[0]]._y+this[dots[0]]._height/2); j = 0; for (i=0; i