Commit adeee341 authored by wjf's avatar wjf

l

parent 1a096253
......@@ -58,7 +58,7 @@ const aniClass = {
"EleDisAni": EleDisAni,
"MagicLionAni": MagicLionAni,
}
const baseScore=20;
const baseScore = 20;
/**
* 直线特效(4) 1.5倍
* 爆炸特效(L) 2.0倍
......@@ -683,9 +683,12 @@ export default class MainScene extends Scene {
this.choosed.parent.removeChild(this.choosed)
}
let fun: Function;
this.elementContainer.addEventListener(egret.TouchEvent.TOUCH_BEGIN, fun = function () {
this.elementContainer.addEventListener(egret.TouchEvent.TOUCH_BEGIN, fun = function (e) {
if (e.target.parent instanceof Element && e.target.parent.type != ElementType.ROCK) {
this.elementContainer.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, fun, this);
this.sendPropUse(prop);
var index = e.target.parent.index;
this.sendPropUse(prop, index);
}
}, this)
} else {
if (!this.stepCircle) {
......@@ -701,7 +704,7 @@ export default class MainScene extends Scene {
this.addChild(this.stepCircle)
}
}
sendPropUse(prop: PropType) {
sendPropUse(prop: PropType, index?: number) {
Loading2.instace.show();
this.removeChild(this.propGuide);
NetManager.ins.hc_useProp((s) => {
......@@ -709,24 +712,47 @@ export default class MainScene extends Scene {
//还原事件
this.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
if (prop == PropType.BOOM || prop == PropType.HAMMER) {
this.enableMouseEvt(false)
this.elementContainer.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.mouseDownE, this);
this.elementContainer.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.mouseMoveE, this);
} else {
this.removeChild(this.stepCircle)
showToast("步数增加成功")
}
if (!s) return
//成功的
switch (prop) {
case PropType.BOOM:
playSound(SoundType.line)
var rc = Tool.indexToRc(index);
var p = Tool.getPositionByIndex(index);
this.playAni(RecoverName.CROSS_ANI, p);
for (var i = 0; i < this.lattices.length; i++) {
var lat = this.lattices[i];
if (Tool.judgeEliminate(lat) && (lat.row == rc[0] || lat.column == rc[1])) {
this.eliminatedElements.push(i);
if (!lat.element.isLock) {
//3倍
this.pushScoreAni(baseScore * 1 * 3, Tool.getPositionByIndex(i))
}
}
}
setTimeout(()=>{
this.eliminate();
},200)
break;
case PropType.HAMMER:
this.eliminatedElements.push(index);
this.eliminate();
break;
case PropType.CHANCE_NUM:
this.steps += 5;
showToast("步数增加成功");
break;
}
//更新道具数量
NetManager.ins.hc_home(() => {
this.updateScene();
}, window['collectRuleId']);
}, prop)
}
mouseDownE(e: egret.TextEvent) {
......@@ -2125,7 +2151,7 @@ export default class MainScene extends Scene {
var txt = codeMsgs[data.code] || "活动太火爆了\n请稍后再来";
showToast(txt);
setTimeout(() => {
SceneCtrl.instance.change(ModuleTypes.MAP_SCENE,createData());
SceneCtrl.instance.change(ModuleTypes.MAP_SCENE, createData());
}, 1300)
}
}
......
......@@ -597,4 +597,5 @@ export const Chapters: ChapterData[] = [
starScores: [11000, 22000, 45000]
},
//////////////////////
]
\ No newline at end of file
......@@ -7,20 +7,7 @@
"wealth": 13,
"totalStars": 120,
"levels": [],
"remainProp": [
{
"type":2,
"num":4
},
{
"type":3,
"num":4
},
{
"type":4,
"num":5
}
],
"remainProp": [],
"remainEnargy": 15,
"askForEnergy": false,
"canReceiveTreasureBoxNum": 10,
......
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