Commit 3f8c001b authored by wildfirecode's avatar wildfirecode

1

parent 0912c937
No preview for this file type
...@@ -41,10 +41,12 @@ ...@@ -41,10 +41,12 @@
<!-- <script src="default.thm.js"></script> --> <!-- <script src="default.thm.js"></script> -->
<script src="output.js"></script> <script src="output.js"></script>
<script> <script>
localStorage.clear();
var __t0__ = Date.now(); var __t0__ = Date.now();
var __debug__ = 1; var __debug__ = 1;
var __monkeyHandSize__ = 50; var __monkeyHandSize__ = 30;
var __boxMoveSpeed__ = 6; var __boxMoveSpeed__ = 1;
var __BOX_CREATE_INTERVAL__ = 60*4;
var __boxOpenState__ = 'resource/assets/startScene/openstate.json'; var __boxOpenState__ = 'resource/assets/startScene/openstate.json';
var __boxmap__ = { var __boxmap__ = {
coin:{ award: 0, skin: 'resource/assets/startScene/coin.json', offset: [117, 68] }, coin:{ award: 0, skin: 'resource/assets/startScene/coin.json', offset: [117, 68] },
......
...@@ -15,4 +15,5 @@ declare var __boxmap__: { [key: string]: IBoxItem }; ...@@ -15,4 +15,5 @@ declare var __boxmap__: { [key: string]: IBoxItem };
declare var __bgUrl__:string; declare var __bgUrl__:string;
declare var __monkeyHandSize__:number; declare var __monkeyHandSize__:number;
declare var __boxMoveSpeed__:number; declare var __boxMoveSpeed__:number;
declare var __BOX_CREATE_INTERVAL__:number;
declare var __boxOpenState__:string; declare var __boxOpenState__:string;
\ No newline at end of file
...@@ -18,7 +18,6 @@ export default class BoxListCtrl { ...@@ -18,7 +18,6 @@ export default class BoxListCtrl {
this._boxKeys = getBoxKeyList(); this._boxKeys = getBoxKeyList();
} }
private BOX_CREATE_INTERVAL = 60 * 1.2;
private _timer: number; private _timer: number;
private _currentBoxIndex = 0; private _currentBoxIndex = 0;
private _frameCounter = 0; private _frameCounter = 0;
...@@ -35,7 +34,7 @@ export default class BoxListCtrl { ...@@ -35,7 +34,7 @@ export default class BoxListCtrl {
onEnterFrame() { onEnterFrame() {
this._frameCounter++; this._frameCounter++;
if (this._frameCounter > this.BOX_CREATE_INTERVAL) { if (this._frameCounter > __BOX_CREATE_INTERVAL__) {
this._frameCounter = 0; this._frameCounter = 0;
this.createBox(); this.createBox();
this._currentBoxIndex++; this._currentBoxIndex++;
......
...@@ -25,7 +25,6 @@ export default class GuideCtrl { ...@@ -25,7 +25,6 @@ export default class GuideCtrl {
onPassMiddle() { onPassMiddle() {
this._main.boxListCtrl.pause(); this._main.boxListCtrl.pause();
this.addGuide(); this.addGuide();
this._main.once(egret.TouchEvent.TOUCH_BEGIN, this.onTouch, this);
} }
tips; tips;
...@@ -38,6 +37,7 @@ export default class GuideCtrl { ...@@ -38,6 +37,7 @@ export default class GuideCtrl {
await this.showtipsAni(tips); await this.showtipsAni(tips);
await this.showhandAni(hand); await this.showhandAni(hand);
await this.showguideAni(guide_dialog); await this.showguideAni(guide_dialog);
this._main.once(egret.TouchEvent.TOUCH_BEGIN, this.onTouch, this);
} }
async showtipsAni(texture) { async showtipsAni(texture) {
...@@ -83,7 +83,7 @@ export default class GuideCtrl { ...@@ -83,7 +83,7 @@ export default class GuideCtrl {
this._main.topLay.removeChild(this._guideTop); this._main.topLay.removeChild(this._guideTop);
this._guideTop = null; this._guideTop = null;
}, this); }, this);
this._main.doAction(); this._main.onTouch();
this._main.addTouchEvent(); this._main.addTouchEvent();
} }
......
...@@ -79,19 +79,15 @@ export default class StartScene extends Scene { ...@@ -79,19 +79,15 @@ export default class StartScene extends Scene {
this.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTouch, this); this.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onTouch, this);
} }
onTouch() {
this._boxListCtrl.pause();
this.doAction();
}
private _catchedBox: Box; private _catchedBox: Box;
private _cathchedBoxOpenState: BoxOpenState; private _cathchedBoxOpenState: BoxOpenState;
doAction() { onTouch() {
this._net.doAction(); this._net.doAction();
const catchedBoxs = this._boxListCtrl.boxs.filter( const catchedBoxs = this._boxListCtrl.boxs.filter(
box => Math.abs(box.y - Box.MIDDLE_Y) < StartScene.NET_RANGE); box => Math.abs(box.y - Box.MIDDLE_Y) < StartScene.NET_RANGE);
const catchedBox = catchedBoxs[0]; const catchedBox = catchedBoxs[0];
if (catchedBox) { //抓住了,box没有办法再过线消失 if (catchedBox) { //抓住了,box没有办法再过线消失
this._boxListCtrl.pause();
//先从boxlist中移除,使之不再受到boxlistCtrl的控制 //先从boxlist中移除,使之不再受到boxlistCtrl的控制
this._boxListCtrl.removeBoxFromList(catchedBox); this._boxListCtrl.removeBoxFromList(catchedBox);
this._catchedBox = catchedBox; this._catchedBox = catchedBox;
......
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