/** * 25-Line ActionScript Contest Entry * * Project: Rampant Growth 3D * Author: Eduard Ruzga aka wonderwhy-er * Date: 26.11.2008 * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ // 3 free lines! Alter the parameters of the following lines or remove them. // Do not substitute other code for the three lines in this section [SWF(width=400, height=400, backgroundColor=0x0, frameRate=30)] stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; // 25 lines begins here! var matrixes:Object = {transformMatrix:new Matrix3D(Vector.([1,0,0,0,0,1,0,0,0,0,1,0,0,0,6,1])),projectionMatrix:new Matrix3D(Vector.([603.5534057617188,0,0,0,0,603.5534057617188,0,0,0,0,0.25,1,0,0,0,0])),growthRotation:[new Matrix3D(Vector.([0.9806308150291443,-0.13781867921352386,0.13917310535907745,0,0.13917310535907745,0.9902680516242981,0,0,-0.13781867921352386,0.019369153305888176,0.9902680516242981,0,0,0,0,1])),new Matrix3D(Vector.([0.9806308150291443,-0.13781867921352386,-0.13917310535907745,0,0.13917310535907745,0.9902680516242981,0,0,0.13781867921352386,-0.019369153305888176,0.9902680516242981,0,0,0,0,1])),new Matrix3D(Vector.([0.9806308150291443,0.13781867921352386,0.13917310535907745,0,-0.13917310535907745,0.9902680516242981,0,0,-0.13781867921352386,-0.019369153305888176,0.9902680516242981,0,0,0,0,1])),new Matrix3D(Vector.([0.9806308150291443,0.13781867921352386,-0.13917310535907745,0,-0.13917310535907745,0.9902680516242981,0,0,0.13781867921352386,0.019369153305888176,0.9902680516242981,0,0,0,0,1]))],siblingOffsets:[new Matrix3D(),new Matrix3D(Vector.([0.5868240594863892,0.49240389466285706,-0.6427876353263855,0,-0.6427876353263855,0.7660444378852844,0,0,0.49240389466285706,0.41317594051361084,0.7660444378852844,0,0,0,0,1])),new Matrix3D(Vector.([0.5868240594863892,0.49240389466285706,0.6427876353263855,0,-0.6427876353263855,0.7660444378852844,0,0,-0.49240389466285706,-0.41317594051361084,0.7660444378852844,0,0,0,0,1])),new Matrix3D(Vector.([0.5868240594863892,-0.49240389466285706,-0.6427876353263855,0,0.6427876353263855,0.7660444378852844,0,0,0.49240389466285706,-0.41317594051361084,0.7660444378852844,0,0,0,0,1])),new Matrix3D(Vector.([0.5868240594863892,-0.49240389466285706,0.6427876353263855,0,0.6427876353263855,0.7660444378852844,0,0,-0.49240389466285706,0.41317594051361084,0.7660444378852844,0,0,0,0,1]))]}; var treeData:Array =[Vector.([0,1,0,0,0.8,0]),new Vector.(),new Vector.(),new Vector.(),[[0,1,0x880000,2]],[[[0,1,0x880000,2],0,0,new Vector3D(0, -0.07, 0)]]]; var differance:Number; function compareLines(a:Array,b:Array):int { return -int((differance = (treeData[2][a[0]*3+2]+treeData[2][a[1]*3+2])/2-(treeData[2][b[0]*3+2]+treeData[2][b[1]*3+2])/2)/Math.abs(differance));} function frame(evt:Event) { for (var i:int=0; i([new GraphicsStroke(treeData[4][i][3]*(10-((treeData[2][treeData[4][i][0]*3+2]+treeData[2][treeData[4][i][1]*3+2])*0.5)),false,"normal",CapsStyle.ROUND,JointStyle.ROUND,3, new GraphicsSolidFill(treeData[4][i][2])),new GraphicsPath(Vector.([1,2]),Vector.([200+treeData[1][treeData[4][i][0]*2],200+treeData[1][treeData[4][i][0]*2+1],200+treeData[1][treeData[4][i][1]*2],200+treeData[1][treeData[4][i][1]*2+1]]))]));} } stage.addEventListener(MouseEvent.MOUSE_DOWN,function(evt:Event){treeData=[Vector.([0,1,0,0,0.8,0]),new Vector.(),new Vector.(),new Vector.(),[[0,1,0x442200,2.4]],[[[0,1,0x442200,2.0],0,0,new Vector3D(0, -0.1, 0)]]];}); addEventListener(Event.ENTER_FRAME,frame); // 25 lines ends here!