作者puck100 (peggy)
看板Flash
标题[问题] 拼图游戏的过关设定
时间Thu Jan 4 08:13:27 2007
我在拼图的影片片段上设了以下的程式:
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