Commit 522e87d9 authored by wildfirecode's avatar wildfirecode

1

parent f5f93e3e
......@@ -45,9 +45,9 @@
<script src="libs/security.js"></script>
<script src="libs/downloadApp.js"></script>
<script>
// localStorage.clear();
// localStorage.setItem('currentLevel','5');
// localStorage.setItem('currentScore','0');
localStorage.clear();
localStorage.setItem('currentLevel','5');
localStorage.setItem('currentScore','9');
window['development'] = true;
var gameId = 1;
var CFG = {
......
......@@ -36,23 +36,26 @@ export default class RotatePannel extends Panel {
if (!this.check()) return;
this.closeBtns.forEach(btn => btn.touchEnabled = false);
this['rotateStart'].touchEnabled = false;
this.showAnimation(3000, 720, false, egret.Ease.sineIn, null)
this.showAnimation(3000, 720*4, false, egret.Ease.sineIn, null)
submitAfterDostart((status, data) => {
let prizeName = data.lottery ? data.lottery.name : ''
this.prizeIndex = this.optionList.findIndex(item => item.name === prizeName)
let deg = this.prizeIndex > -1 ? 180 - this.prizeIndex * 45 : - 22.5
this.showAnimation(4000, 1080 + deg, false, egret.Ease.sineOut, () => {
wait(300).then(() => {
if (gameIsWinning()) {
PanelCtrl.instance.show(ModuleTypes.PRIZE_PANEL);
} else {
PanelCtrl.instance.show(ModuleTypes.NO_PRIZE_PANEL);
}
});
wait(300).then(() => {
NetManager.ins.getInfo()
});
this.showAnimation(3000, 720*4, false, egret.Ease.sineOut, () => {
});
wait(1000).then(() => {
if (gameIsWinning()) {
PanelCtrl.instance.show(ModuleTypes.PRIZE_PANEL);
} else {
PanelCtrl.instance.show(ModuleTypes.NO_PRIZE_PANEL);
}
});
wait(300).then(() => {
NetManager.ins.getInfo()
});
}, 30);
}
......
......@@ -32,7 +32,7 @@ export default class SlotPanel extends Panel {
this.speed = 1
this.dis = 0
this.N = 2
this.INITALSPEED = 30
this.INITALSPEED = 70
if (!DataManager.ins.getOptionsData)
NetManager.ins.getOptions(() => {
this.initSlot()
......@@ -75,17 +75,17 @@ export default class SlotPanel extends Panel {
this.dis = this.Do
this.speed = 0
egret.stopTick(this.onTick, this);
wait(500).then(() => {
if (gameIsWinning()) {
PanelCtrl.instance.show(ModuleTypes.PRIZE_PANEL);
} else {
PanelCtrl.instance.show(ModuleTypes.NO_PRIZE_PANEL);
}
});
wait(300).then(() => {
NetManager.ins.getInfo()
// this.gameReset()
});
// wait(500).then(() => {
// if (gameIsWinning()) {
// PanelCtrl.instance.show(ModuleTypes.PRIZE_PANEL);
// } else {
// PanelCtrl.instance.show(ModuleTypes.NO_PRIZE_PANEL);
// }
// });
// wait(300).then(() => {
// NetManager.ins.getInfo()
// // this.gameReset()
// });
return
}
this.speed = (1 - this.dis / this.Do) * this.INITALSPEED
......@@ -99,7 +99,7 @@ export default class SlotPanel extends Panel {
if (!this.check()) return;
this.closeBtns.forEach(btn => btn.touchEnabled = false);
this['slotStartBtn'].touchEnabled = false;
this.calcSpeed(1, this.INITALSPEED)
this.calcSpeed(10, this.INITALSPEED)
.then(() => {
this.stop()
})
......@@ -127,11 +127,25 @@ export default class SlotPanel extends Panel {
stop() {
submitAfterDostart((status, data) => {
let prizeName = data.lottery ? data.lottery.name : ''
wait(2000).then(() => {
wait(1000).then(() => {
let hashIndex = this.optionList.findIndex(item => item.name === prizeName)
this.prizeItem = this.itemList[hashIndex]
this.Do = (this.prizeItem ? this.prizeItem.x : -100) - 384 + this.N * this.itemList.length * this.itemWidth
wait(1).then(() => {
if (gameIsWinning()) {
PanelCtrl.instance.show(ModuleTypes.PRIZE_PANEL);
} else {
PanelCtrl.instance.show(ModuleTypes.NO_PRIZE_PANEL);
}
});
wait(1).then(() => {
NetManager.ins.getInfo()
// this.gameReset()
});
})
}, 20);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment