Commit 522e87d9 authored by wildfirecode's avatar wildfirecode

1

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