Commit 6ef16c25 authored by wjf's avatar wjf

l

parent 56aea6af
......@@ -533,6 +533,9 @@ export default class MainScene extends Scene {
this.boomBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_boomBtn, this)
this.hammerBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_hammerBtn, this)
this.stepBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_stepBtn, this)
this.elementContainer.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.mouseDownE, this);
this.elementContainer.removeEventListener(egret.TouchEvent.TOUCH_MOVE, this.mouseMoveE, this);
}
onEnterFrame() {
if (this.enableTouch) {
......@@ -549,43 +552,43 @@ export default class MainScene extends Scene {
}
//出现交换提示
warningAni() {
if (this.isShowWarning) {
var a = this.warningCop[0];
var b = this.warningCop[1];
var ax = a.x;
var ay = a.y;
var bx = b.x;
var by = b.y;
egret.Tween.get(a, { loop: true })
.to({ x: (bx - ax) / 10 + ax, y: (by - ay) / 10 + ay }, 100)
.to({ x: ax, y: ay }, 100)
.wait(200)
.to({ x: (bx - ax) / 10 + ax, y: (by - ay) / 10 + ay }, 100)
.to({ x: ax, y: ay }, 100)
.wait(400)
egret.Tween.get(b, { loop: true })
.to({ x: (ax - bx) / 10 + bx, y: (ay - by) / 10 + by }, 100)
.to({ x: bx, y: by }, 100)
.wait(200)
.to({ x: (ax - bx) / 10 + bx, y: (ay - by) / 10 + by }, 100)
.to({ x: bx, y: by }, 100)
.wait(400)
} else {
egret.Tween.removeTweens(this.warningCop[0]);
egret.Tween.removeTweens(this.warningCop[1]);
//还原位置
var a = this.warningCop[0];
var b = this.warningCop[1];
var aIndex = a.index;
var bIndex = b.index;
var ap = Tool.getPositionByIndex(aIndex);
var bp = Tool.getPositionByIndex(bIndex);
a.x = ap[0];
a.y = ap[1];
b.x = bp[0];
b.y = bp[1];
}
var a = this.warningCop[0];
var b = this.warningCop[1];
var ax = a.x;
var ay = a.y;
var bx = b.x;
var by = b.y;
egret.Tween.get(a, { loop: true })
.to({ x: (bx - ax) / 10 + ax, y: (by - ay) / 10 + ay }, 100)
.to({ x: ax, y: ay }, 100)
.wait(200)
.to({ x: (bx - ax) / 10 + ax, y: (by - ay) / 10 + ay }, 100)
.to({ x: ax, y: ay }, 100)
.wait(400)
egret.Tween.get(b, { loop: true })
.to({ x: (ax - bx) / 10 + bx, y: (ay - by) / 10 + by }, 100)
.to({ x: bx, y: by }, 100)
.wait(200)
.to({ x: (ax - bx) / 10 + bx, y: (ay - by) / 10 + by }, 100)
.to({ x: bx, y: by }, 100)
.wait(400)
}
//重置移动提示
resetWarning() {
if (!this.warningCop) return
egret.Tween.removeTweens(this.warningCop[0]);
egret.Tween.removeTweens(this.warningCop[1]);
//还原位置
var a = this.warningCop[0];
var b = this.warningCop[1];
var aIndex = a.index;
var bIndex = b.index;
var ap = Tool.getPositionByIndex(aIndex);
var bp = Tool.getPositionByIndex(bIndex);
a.x = ap[0];
a.y = ap[1];
b.x = bp[0];
b.y = bp[1];
}
onTap_settingBtn() {
this.settingGroup.visible = !this.settingGroup.visible;
......@@ -619,7 +622,7 @@ export default class MainScene extends Scene {
//购买弹框
PanelCtrl.instance.show("Buy1")
} else {
//弹出蒙层,点蒙层关闭,点击任意元素,去掉容器的事件
}
}
onTap_hammerBtn() {
......@@ -645,6 +648,19 @@ export default class MainScene extends Scene {
}
}
//使用道具逻辑
useProp() {
//去掉移动提示侦听
this.removeEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
//去掉如果正在提示着的话
if (this.isShowWarning) {
this.isShowWarning = false;
this.resetWarning();
}
//
}
mouseDownE(e: egret.TextEvent) {
// if (!this.enableTouch) return
var self = this;
......@@ -652,7 +668,7 @@ export default class MainScene extends Scene {
//去掉提示动画
this.isShowWarning = false;
this.noActionCount = 0;
this.warningAni();
this.resetWarning();
// e.target.parent.isLock = true;
// e.target.parent.lockAni.play()
// var a=new ThreeCrossAni();
......@@ -2039,7 +2055,7 @@ export default class MainScene extends Scene {
}
} else {
//失败直接显示未中奖
PanelCtrl.instance.show(ModuleTypes.NO_PRIZE_PANEL, { starCount: this.scoreProgress.starCount });
}
},
DataManager.ins.getData("hc_doJoin").data,
......
......@@ -51,13 +51,13 @@ export default class StartPanel extends Panel {
onTap_startBtn() {
this.hidePanel();
this['startBtn'].enabled = false;
window['getRST']();
if (window['getRST']) window['getRST']();
hdGameDoDojoin((success) => {
this['startBtn'].enabled = true;
if (success) {
SceneCtrl.instance.change(ModuleTypes.MAIN_SCENE, { chapter: this._level });
}
},this._level)
}, this._level)
}
onTap_buy1btn() {
PanelCtrl.instance.show('Buy1');
......
......@@ -24,7 +24,7 @@ const config = {
'/hdtool/happyclear/submit': {
data: './happyclear/submit.json'
},
'/hdtool/happyclear/submit': {
'/hdtool/happyclear/doJoin': {
data: './happyclear/doJoin.json'
},
'/aaw/music/category': {
......
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