Blogtrottr
Yahoo!奇摩知識+ - 分類問答 - 電腦網路 - 發問中
Yahoo!奇摩知識+ - 分類問答 - 電腦網路 - 發問中 
請問flash as2.0 滑鼠指令無效如何寫
Jul 31st 2013, 19:23

我最近在做一個小遊戲
用滑鼠控制熊(bear)來吃金幣
天上會掉炸彈
路上會碰到敵人 按下滑鼠可以跳過去
如果碰到敵人的話熊會飛到天空變星星

但是我現在有幾個地方卡關
1.碰到敵人之後滑鼠按下的語法(onMouseDown)要變成無效
2.熊碰到炸彈後會播放他被炸到的樣子2秒,然後所有滑鼠指令(拖曳&跳越)也要延遲兩秒才能繼續動 並且回到熊原來的樣子
3.敵人出現機率:我有三種敵人,有一隻想要10% 其他兩隻各45%

以下是我寫的程式:

startDrag("bear", true,-1, 530, 950,530);
Mouse.hide();

if(bear.hitTest(deer)){ //碰到敵人

this.stopDrag();
this.stop();
bear.gotoAndStop(4); //播放熊飛出去的畫面之後結束遊戲
total = 0;

}

if(bear.hitTest(bomb)){ //碰到炸彈

bomb.gotoAndStop(1);
sound1 = new Sound();
sound1.loadSound("boom.mp3",true);
total = total- 60;

bear.gotoAndStop(2); //會播放他被炸的樣子

}

this.bear.onMouseDown = function() {
//按下去熊會跳起來,我想要碰到敵人後這邊的滑鼠語法變無效

this.gotoAndStop(3);
sound2 = new Sound();
sound2.loadSound("彈跳.mp3",true);
}

this.bear.onMouseUp = function() {
this.gotoAndStop(1);
}

問題蠻多的
請高手幫我解答~~~~謝謝!!!

This entry passed through the Full-Text RSS service — if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers. Five Filters recommends: 'You Say What You Like, Because They Like What You Say' - http://www.medialens.org/index.php/alerts/alert-archive/alerts-2013/731-you-say-what-you-like-because-they-like-what-you-say.html

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 kko2oj3x91bmh 的頭像
    kko2oj3x91bmh

    派遣女醫x線上看 派遣女醫x劇情 派遣女醫x第2部 派遣女醫x 線上 派遣女醫x 2 派遣女醫x 2線上看 派遣女醫x第二部 派遣女醫x第2部線上看

    kko2oj3x91bmh 發表在 痞客邦 留言(0) 人氣()