《《让代码飞》教程网打地鼠游戏主面板代码.doc》由会员分享,可在线阅读,更多相关《《让代码飞》教程网打地鼠游戏主面板代码.doc(3页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、让代码飞教程网打地鼠游戏主面板代码import flash.events.Event;import flash.events.MouseEvent;import flash.text.TextField;import flash.text.TextFormat;stop();var da:int = 0;var kou:int = 5;var str:String = 您当前的得分是:;var txt:TextField=new TextField();var tf:TextFormat=new TextFormat();var txt2:TextField=new TextField();v
2、ar tf2:TextFormat=new TextFormat();tf2.color = 0xff0000;tf2.size = 36;txt2.width = 300;txt2.y = 100;txt2.x = 150;txt2.selectable = false;txt2.height = 60;var btn1:btn=new btn();btn1.x = 220;btn1.y = 170;tf.size = 24;tf.color = 0xff;txt.text = str + da.toString();txt.setTextFormat(tf);addChild(txt);t
3、xt.width = 300;txt.selectable = false;var arr:Array=new Array();for (var i:int=0; i10; i+)arri=new mc();var x1:int = i % 5;var y1:int = i / 5;arri.x = x1 * 100 + 65;arri.y = 280 + y1 * 80;arri.stop();arri.mouseChildren = false;arri.addEventListener(MouseEvent.MOUSE_DOWN,onmousedown);addChild(arri);
4、var kk = setInterval(up,1500);addEventListener(Event.ENTER_FRAME,onenterframe);function onenterframe(e:Event)chui_mc.x = mouseX + 90;chui_mc.y = mouseY;for (var i:int=0; i 3 & e.target.currentFrame 27)e.target.gotoAndPlay(31);da += 1;txt.text = str + da;txt.setTextFormat(tf);function up()var r:int = Math.random() * 10;arrr.gotoAndPlay(1);btn1.addEventListener(MouseEvent.CLICK,onclick)function onclick(e:MouseEvent)kou=0da=0addEventListener(Event.ENTER_FRAME,onenterframe)kk=setInterval(up,1500)removeChild(txt2);removeChild(btn1);txt.text = str + da;txt.setTextFormat(tf);