/** * 25-Line ActionScript Contest Entry * * Project: 25lineDisco * Author: Thomas Kräftner * Date: 28.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=600, height=600, backgroundColor=0x000000, frameRate=12)] stage.scaleMode = StageScaleMode.NO_SCALE; // 25 lines begins here! var bmp:Bitmap = Bitmap(stage.addChild(new Bitmap(new BitmapData(stage.stageWidth, stage.stageHeight,false,0xFF000000)))); var canvas:Sprite = Sprite(stage.addChild(new Sprite())); var spikes:Vector. = new Vector.(); for (var i:int = 0; i < 6; i++) { spikes.push([ new Point(300, 300), i*60, new Array([2, -0.002], [ -4, 0.002], [4, 0.002], [ -2, -0.002]), 0x333333, 0x111111, 3.5 ],[ new Point(300, 300), i*60+20, new Array([2, -0.004], [ -4, 0.004], [4, 0.004], [ -2, -0.004]), 0xAAAAAA, 0x111111, 1.7 ],[ new Point(300, 300), i*60+40, new Array([6, 0.003], [6, 0.003], [6, 0.003], [6, 0.003], [6, 0.003], [6, 0.003], [6, 0.003], [6, 0.003], [6, 0.003], [6, 0.003], [6, 0.003], [6, 0.003], [6, 0.003], [6, 0.003], [6, 0.003], [6, 0.003], [6, 0.003], [6, 0.003], [6, 0.003], [6, 0.003], [-6, 0.003], [-6, 0.003], [-6, 0.003], [-6, 0.003], [-6, 0.003], [-6, 0.003], [-6, 0.003], [-6, 0.003], [-6, 0.003], [-6, 0.003], [-6, 0.003], [-6, 0.003], [-6, 0.003], [-6, 0.003], [-6, 0.003], [-6, 0.003], [-6, 0.003], [-6, 0.003], [-6, 0.003], [-6, 0.003]), 0x333333, 0x111111, 3 ]); } addEventListener(Event.ENTER_FRAME, step); function step(t:Event):void { if(!Math.round(Math.random() * 0)) bmp.bitmapData.draw(canvas); canvas.graphics.clear(); if(!Math.round(Math.random() * 3)) bmp.bitmapData.draw(new BitmapData(stage.stageWidth, stage.stageHeight, true, 0x01000000)); if(!Math.round(Math.random() * 4)) bmp.bitmapData.applyFilter(bmp.bitmapData, new Rectangle(0, 0, stage.stageWidth, stage.stageHeight), new Point(), new BlurFilter(2,2)); for (var i:int = 0; i < spikes.length; i++) { draw( new Point(0, 0),spikes[i][0],spikes[i][1],spikes[i][2],spikes[i][3],spikes[i][4],spikes[i][5]); } } function draw(op:Point,center:Point,winkel:Number, winkelArray:Array, color:Number=0x666666, mcolor:Number=0x000000, thickness:Number=4, min:Number = 0.5, tm:Number=0.975, c:int=0):void { while (center.x>0 && center.x0 && center.ymin){ for (var i:int = 0; i < winkelArray.length; i++) { Math.abs(winkelArray[i][0]) < Math.round(Math.random() * 4)+7 ? winkelArray[i][0] = winkelArray[i][0] + winkelArray[i][1] : winkelArray[i][0] = winkelArray[i][0] + (winkelArray[i][1]*=-1); } var on:Point = new Point((op.subtract(center).y/op.subtract(center).length)*(thickness *= tm), -(op.subtract(center).x/op.subtract(center).length)*thickness); op = center.clone(); center = center.add(Point.polar(Math.round(Math.random() * 0)+4, (winkel+= winkelArray[c= winkelArray.length>c+1 ? c+1 : 0][0]) * Math.PI * 2 / 360)); var n:Point = new Point((op.subtract(center).y/op.subtract(center).length)*thickness, -(op.subtract(center).x/op.subtract(center).length)*thickness); canvas.graphics.lineStyle(); canvas.graphics.beginFill(color+=0x010203,0.4); if(!Math.round(Math.random()*1)){ canvas.graphics.drawPath(Vector.([1,2,2,2,2,2,2]),Vector.([op.x+on.x,op.y+on.y,op.x+on.x,op.y+on.y,op.x,op.y,op.x-on.x,op.y-on.y,center.x-n.x,center.y-n.y,center.x,center.y,center.x+n.x,center.y+n.y])); canvas.graphics.lineStyle(1, mcolor,0.5); canvas.graphics.drawPath(Vector.([1,2]),Vector.([op.x,op.y,center.x,center.y])); } if(Math.abs(winkelArray[c][0]-2)<.04) canvas.graphics.drawCircle(center.x,center.y,Math.abs(winkelArray[c][0]-2)*200); } } // 25 lines ends here!