[問題] 拼圖遊戲的過關設定
我在拼圖的影片片段上設了以下的程式:
on (press) {
if (this.a != 1) {
this.startDrag();
_alpha = 30;
}
}
on (release, releaseOutside) {
this.stopDrag();
_alpha = 100;
hantei = this.hitTest(_root.place01);
if (hantei == true) {
_x = _root.place01._x;
_y = _root.place01._y;
_root.aaa = _root.aaa+1;
this.a = 1;
if (_root.aaa == 9) {
_root.gotoAndPlay("win");
}
}
}
要設定時間歸零後且完成拼圖時要跳關,若時間超過未完成者則跳到失敗的畫面!
目前設了過後變成時間不會倒數,但是拼圖完成後會自動跳關。
請問要怎樣讓時間能夠倒數,另外時間若超過而未完成的話要怎麼跳至失敗的畫面呢?
以下是若時間歸零就跳關的程式:
stop();
_root.aaa=0
_root.onEnterFrame = function() {
if (this.timer_mc.countDown_mc.countDown_txt.text == 0) {
gotoAndPlay("Scene 5", 1);
}
};
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.230.19.247