spiral 螺旋作ってみました。 。 snaf forked:1favorite:4lines:53license : MIT License modified : 2011-10-17 21:42:52 Embed Tweet package { import flash.display.Sprite; import flash.events.Event; import flash.events.MouseEvent; import flash.display.*; import flash.utils.Timer; import flash.events.TimerEvent; public class Spiral extends Sprite{ private var mc:Sprite; private var timer:Timer=new Timer(250); private var mc_array:Array=new Array(); public function Spiral() { addEventListener(Event.ENTER_FRAME,xEnterframe); timer.addEventListener(TimerEvent.TIMER,getMcEvent); timer.start(); } private function xEnterframe(e:Event):void{ for(var i:int=0;i<mc_array.length;i++){ mc_array[i].y+=1; mc_array[i].rotationY-=4.5; if(mc_array[i].y>stage.stageHeight){ removeChild(mc_array[i]); var remove_mc:Array=mc_array.splice(i,1); } if(mc_array[i].x>=225&&mc_array[i].x<325&&mc_array[i].z<200&&mc_array[i].z>=0){ mc_array[i].x+=5; mc_array[i].z+=10; }else if(mc_array[i].x>225&&mc_array[i].x<=325&&mc_array[i].z>=200&&mc_array[i].z<800){ mc_array[i].x-=5; mc_array[i].z+=10; }else if(mc_array[i].x<=225&&mc_array[i].x>125&&mc_array[i].z>200&&mc_array[i].z<=800){ mc_array[i].x-=5; mc_array[i].z-=10; }else if(mc_array[i].x<225&&mc_array[i].x>=125&&mc_array[i].z<=200&&mc_array[i].z>0){ mc_array[i].x+=5; mc_array[i].z-=10; } } } private function getMcEvent(e:TimerEvent):void{ mc=new Sprite(); mc.graphics.beginFill(0); mc.graphics.drawRect(0,0,25,15); mc.graphics.endFill(); addChild(mc); mc.x=225; mc_array.push(mc); mc_array[mc_array.length-1].x=225; mc_array[mc_array.length-1].y=0; addChild(mc_array[mc_array.length-1]); } } } Code Fullscreen Preview Fullscreen satosu andrewexex88.. kleinschmidt.. hidrodixtion.. : coolmathshape cool math shape spiral timer グレンラガン 天元突破 螺旋 length rotationY addEventListener removeChild TimerEvent.ENTER_FRAME TimerEvent Timer start splice addChild drawRect TimerEvent.TIMER endFill beginFill stageHeight push Array Sprite int sort new page view favorite forked pv121 forked from: spiral HowledRoll forked:0 favorite:0lines:67 (diff:36)