0
我打算做拔河比賽,並且我在這部分中遇到困難......遊戲是用戶必須快速點擊按鈕才能贏得比賽。我在數字使它1次點擊= + 1,並在同一時間或不通過0.5我怎樣才能連續減少as3中的數字
感謝一下控制器的值減小的幫助
var controller = 10;
blocker.visible = false;
function decreasing(){
controller = controller - 0.5;
}
decreasing();
pushBtn.addEventListener(MouseEvent.CLICK, theGame);
function theGame (e:MouseEvent): void {
controller = controller + 1;
if ((controller <= 5) || (controller >=9)){
ropeMc.gotoAndPlay("down1");
}
if ((controller <= 1) || (controller >=4)){
ropeMc.gotoAndPlay("down1");
}
if ((controller >= 15) || (controller <=19)){
ropeMc.gotoAndPlay("up1");
}
if ((controller >= 20) || (controller <=29)){
ropeMc.gotoAndPlay("up2");
}
if (controller >= 30){
ropeMc.gotoAndStop(20);
blocker.visible = true;
}
}
謝謝你的工作,介意如果你解釋你做了什麼? – BlueDragon
歡迎您:)。標記答案。 –
stage.addEventListener(Event.ENTER_FRAME,decrease); – BlueDragon