/** * 25-Line ActionScript Contest Entry * * Project: logoGap * Author: Matthias Dittgen * Date: 2008/11/28 * * Comment: I hope to not break Rule 13 of the Rules * (http://www.25lines.com/?page_id=96) * with some of the big lines, which I mainly * use to draw my Vector Sprites. * * Address: Matthias Dittgen * Finowstraße 23 * D 10247 Berlin * Germany * * skype: negttid * icq: 381530882 * * 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=0x000000, frameRate=31)] stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; stage.quality = StageQuality.BEST; // 25 lines begins here! var mind:Object={score:0,lives:5,keyArray:[]}; var propSetter:Function=function(element:*, props:Object):void{for (var key:String in props) element[key]=props[key];}; (mind.mc=addChildAt(new MovieClip(),0) as MovieClip).graphics.drawGraphicsData(Vector.([new GraphicsSolidFill(0xffffff,1),new GraphicsPath(Vector.([1,3,2,3,2,3,2,2,2,3,2]),Vector.([-25.7,19.3,-14.3,20.0,-8.0,3.0,-3.0,-10.0,5.7,-32.3,25.7,-32.3,25.7,-19.3,15.0,-20.0,9.7,-6.7,19.3,-6.7,19.3,6.3,4.3,6.3,-5.0,33.0,-25.7,32.3,-25.7,19.3])),new GraphicsEndFill()])); (mind.fl=addChildAt(new MovieClip(),0) as MovieClip).graphics.drawGraphicsData(Vector.([new GraphicsStroke(1,false,"normal","none","round",3.0,new GraphicsGradientFill(GradientType.RADIAL,[0xffffff,0xffffff,0xffffff],[0,0.8,0.7],[90,254,255],new Matrix(0.245,0,0,0.245,200,200),SpreadMethod.PAD,"rgb",0)),new GraphicsPath(Vector.([1,2,1,2,1,2,1,2]), Vector.([200,200,0,0,200,200,400,0,200,200,0,400,200,200,400,400])),new GraphicsEndFill()])); propSetter((mind.tf=addChildAt(new TextField(),0) as TextField), {htmlText:'',wordWrap:true,selectable:false,autoSize:TextFieldAutoSize.CENTER,multiline:true,width:380,x:10,y:300}); Mouse.hide(); addEventListener(MouseEvent.MOUSE_WHEEL,function(e:MouseEvent):void{propSetter(mind.mc,{rotation:mind.mc.rotation+(e.delta*3)});}); stage.addEventListener(KeyboardEvent.KEY_DOWN, function(e:KeyboardEvent) {mind.key=(e.keyCode==Keyboard.RIGHT?"r":e.keyCode==Keyboard.LEFT?"l":"n");}); stage.addEventListener(KeyboardEvent.KEY_UP, function(e:KeyboardEvent) {mind.key="n";}); var rotatePointByAngle:Function=function(x:Number,y:Number,ra:Number,rx:Number,ry:Number,p:Point=null):Array{return [rx+(p=new Point(x, y)).length*Math.cos(Math.atan2(y,x)+ra/180*Math.PI),ry+p.length*Math.sin(Math.atan2(y, x)+ra/180*Math.PI)]}; var generatePlane:Function=function(rx:Number, ry:Number, ra:Number, m:MovieClip = null):void{ (m=addChildAt(new MovieClip(),0) as MovieClip).graphics.drawGraphicsData(Vector.([new GraphicsStroke(5,false,"normal","none","round",3.0,new GraphicsSolidFill(0xffffff, 0.3)),new GraphicsGradientFill(GradientType.RADIAL,[0xee0000,0x330000],[0.8,0.8],[0,255],new Matrix(0.37,0,0,0.37,-50,-50),SpreadMethod.PAD,"rgb",0),new GraphicsPath(Vector.([1,2,2,2,2,1,3,2,3,2,3,2,2,2,3,2]),Vector.([-200,-200,-200,200,200,200,200,-200,-200,-200].concat(rotatePointByAngle(-35.8,20.8,ra,rx,ry)).concat(rotatePointByAngle(-20.0,22.9,ra,rx,ry)).concat(rotatePointByAngle(-13.3,2.1,ra,rx,ry)).concat(rotatePointByAngle(-7.9,-12.5,ra,rx,ry)).concat(rotatePointByAngle(5.0,-46.3,ra,rx,ry)).concat(rotatePointByAngle(36.3,-44.2,ra,rx,ry)).concat(rotatePointByAngle(35.8,-20.8,ra,rx,ry)).concat(rotatePointByAngle(23.3,-22.5,ra,rx,ry)).concat(rotatePointByAngle(17.9,-12.1,ra,rx,ry)).concat(rotatePointByAngle(28.3,-12.1,ra,rx,ry)).concat(rotatePointByAngle(28.3,11.3,ra,rx,ry)).concat(rotatePointByAngle(8.3,11.3,ra,rx,ry)).concat(rotatePointByAngle(-4.6,45.4,ra,rx,ry)).concat(rotatePointByAngle(-35.8,44.2,ra,rx,ry)).concat(rotatePointByAngle(-35.8,20.8,ra,rx,ry)))),new GraphicsStroke()])); m.filter=[new GlowFilter()]; propSetter(m,{x:200,y:200,scaleX:0.2,scaleY:0.2,rx:rx,ry:ry,ra:ra});}; addEventListener(Event.ENTER_FRAME, (mind.ef = function(e:Event):void{ mind.mc.rotation+=(mind.key=="r"?5:mind.key=="l"?-5:0); propSetter(mind.mc,{x:stage.mouseX,y:stage.mouseY}); if (numChildren<8 && getChildAt(0).scaleX>(Math.random()*02+0.4)) generatePlane((-160+Math.round(Math.random()*300)),(-160+Math.round(Math.random()*300)),Math.random()*360); if (numChildren>4 && ((mind.temp=getChildAt(numChildren-4)) as MovieClip).scaleX>=1){ if ((mind.temp.rx+200-stage.mouseX)>-10 && (mind.temp.rx+200-stage.mouseX)<10 && (mind.temp.ry+200-stage.mouseY)>-10 && (mind.temp.ry+200-stage.mouseY)<10 && (mind.temp.ra-(mind.mc.rotation<0?360+mind.mc.rotation:mind.mc.rotation))<10 && mind.lives>0) mind.score++; else if (mind.lives>0) mind.lives--; removeChildAt(numChildren-4);} //mind.gameovercheck=(mind.lives<1?removeEventListener(Event.ENTER_FRAME,mind.ef):removeChildAt(numChildren-4));} propSetter(mind.tf,{htmlText:'

'+(mind.lives==0?'GAME OVER':' ')+'
LIVES: '+'♥♥♥♥♥'.substr(0,mind.lives)+''+'♥♥♥♥♥'.substr(0,5-mind.lives)+' SCORE: '+(mind.score==undefined?(mind.score=0):mind.score)+'
Move your mouse to fit the >f< into the topmost gap, use the mouse wheel or left/right keys on your keyboard to rotate it accordingly. The flashplayer logo is a trademark of Adobe. Created by Matthias Dittgen as submission to the 25lines.com contest, November 2008.

',wordWrap:true,selectable:false,autoSize:TextFieldAutoSize.CENTER,multiline:true,width:380,x:10,y:280}); for (var i:Number=numChildren-4;i>-1;i--) getChildAt(i).scaleX=getChildAt(i).scaleY=(getChildAt(i).scaleX*1.01);})); // 25 lines ends here!