[問題] 想做類似打地鼠 卻沒有辦法@@"
因為想做一個打地鼠的遊戲,但是加分的部分加上去以後就不行了
原本可以讓我的mouse每兩秒出現在螢幕上 一秒後又消失的說.....
可以幫我看一下嗎@@"
謝謝大家!!!
--------------以下是程式碼------------------------
var score : int = 0;
var playgame = new Timer(2000,20);
playgame.addEventListener(TimerEvent.TIMER,onetime);
playgame.start();
function onetime(event:TimerEvent){
var mouse : Mouse;
mouse = new Mouse();
mouse.x = Math.random()*550;
mouse.y = Math.random()*400;
addChild(mouse)
var looktime = new Timer(1000,1);
looktime.addEventListener(TimerEvent.TIMER_COMPLETE,mouseend);
looktime.start();
---------------------------------------------------這段加上就不行了
mouse.addEventListener(MouseEvent.CLICK,hit);
function hit(event:MouseEvent){
score = score + 1
removeChild(mouse)
}
----------------------------------------------------
function mouseend(event:TimerEvent){
removeChild(mouse)
}
}
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.42.241.111
※ 文章網址: http://www.ptt.cc/bbs/Flash/M.1398001875.A.1EF.html
→
04/20 22:03, , 1F
04/20 22:03, 1F
→
04/20 22:04, , 2F
04/20 22:04, 2F
→
04/20 22:05, , 3F
04/20 22:05, 3F
推
04/21 11:32, , 4F
04/21 11:32, 4F
→
04/21 11:33, , 5F
04/21 11:33, 5F
推
04/22 23:24, , 6F
04/22 23:24, 6F
推
04/22 23:28, , 7F
04/22 23:28, 7F
→
04/22 23:28, , 8F
04/22 23:28, 8F
→
04/22 23:28, , 9F
04/22 23:28, 9F
→
04/22 23:28, , 10F
04/22 23:28, 10F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):
Flash 近期熱門文章
PTT數位生活區 即時熱門文章