Commit 4d0ae93f authored by wildfirecode's avatar wildfirecode

Merge branch 'dev' of gitlab2.dui88.com:wanghongyuan/xiaoxiaole into dev

parents c21f6477 4daf2ad9
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"globalBackgroundHeight": -1, "globalBackgroundHeight": -1,
"globalBackgroundColor": "#ffffff", "globalBackgroundColor": "#ffffff",
"globalBackgroundImage": "/Users/wanghongyuan/db-game-template/egret/resource/assets/startScene/startscenebg.jpg", "globalBackgroundImage": "/Users/wanghongyuan/db-game-template/egret/resource/assets/startScene/startscenebg.jpg",
"globalAutoLayerMarkEnable": true "globalAutoLayerMarkEnable": false
}, },
"1667fb18fa6": { "1667fb18fa6": {
"bindingDataTestObj": [ "bindingDataTestObj": [
......
...@@ -164,6 +164,9 @@ export default class MainBase extends eui.UILayer { ...@@ -164,6 +164,9 @@ export default class MainBase extends eui.UILayer {
RES.getResAsync("guideTxt" + i + "_png") RES.getResAsync("guideTxt" + i + "_png")
} }
var arr = [ var arr = [
"boomBtn",
"hammerBtn",
"stepBtn",
"propNumBg", "propNumBg",
"guideBg", "guideBg",
"guideKnowBtn", "guideKnowBtn",
......
...@@ -3,7 +3,6 @@ import { NetManager } from './../../libs/tw/manager/NetManager'; ...@@ -3,7 +3,6 @@ import { NetManager } from './../../libs/tw/manager/NetManager';
import { Buried } from './../../libs/tw/util/Buried'; import { Buried } from './../../libs/tw/util/Buried';
import { Tool } from '../something/Tool'; import { Tool } from '../something/Tool';
import { drawBg, generateMapBg } from '../something/logic/aaa'; import { drawBg, generateMapBg } from '../something/logic/aaa';
import { PathData } from '../something/interface/PathData';
import { ChapterData } from '../something/interface/ChapterData'; import { ChapterData } from '../something/interface/ChapterData';
import { Lattice } from '../something/class/Lattice'; import { Lattice } from '../something/class/Lattice';
import { Pool } from '../something/Pool'; import { Pool } from '../something/Pool';
...@@ -33,9 +32,7 @@ import Scene from '../../libs/new_wx/components/Scene'; ...@@ -33,9 +32,7 @@ import Scene from '../../libs/new_wx/components/Scene';
import { showToast } from '../../libs/new_wx/ctrls/toastCtrl'; import { showToast } from '../../libs/new_wx/ctrls/toastCtrl';
import getResPath from '../../libs/new_tc/getResPath'; import getResPath from '../../libs/new_tc/getResPath';
import PanelCtrl from '../../libs/new_wx/ctrls/panelCtrl'; import PanelCtrl from '../../libs/new_wx/ctrls/panelCtrl';
import { ModuleType } from '../../libs/tc/enum/ModuleType';
import { ModuleTypes } from '../../libs/new_wx/types/sceneTypes'; import { ModuleTypes } from '../../libs/new_wx/types/sceneTypes';
import { ElementTarget } from '../something/uis/ElementTarget';
import { ElementTargets } from '../something/uis/ElementTargets'; import { ElementTargets } from '../something/uis/ElementTargets';
import { Chapters } from '../something/Chapters'; import { Chapters } from '../something/Chapters';
import { FlyTargetAni } from '../something/anis/FlyTargetAni'; import { FlyTargetAni } from '../something/anis/FlyTargetAni';
...@@ -46,9 +43,8 @@ import { getlogItem } from '../Main'; ...@@ -46,9 +43,8 @@ import { getlogItem } from '../Main';
import getHomeData, { getPropNums } from '../getHomeData'; import getHomeData, { getPropNums } from '../getHomeData';
import PropType from '../PropType'; import PropType from '../PropType';
import { PropNumShow } from '../something/uis/PropNumShow'; import { PropNumShow } from '../something/uis/PropNumShow';
import { NetName } from '../../libs/tw/enum/NetName';
import SceneCtrl from '../../libs/new_wx/ctrls/sceneCtrl'; import SceneCtrl from '../../libs/new_wx/ctrls/sceneCtrl';
// import BridgeFactory from "../../libs/JSBridge/bridge/BridgeFactory"; import { PropGuide } from '../something/uis/PropGuide';
const aniClass = { const aniClass = {
"BoomAni": BoomAni, "BoomAni": BoomAni,
...@@ -189,6 +185,8 @@ export default class MainScene extends Scene { ...@@ -189,6 +185,8 @@ export default class MainScene extends Scene {
boomBtnNum: PropNumShow; boomBtnNum: PropNumShow;
hammerBtnNum: PropNumShow; hammerBtnNum: PropNumShow;
stepBtnNum: PropNumShow; stepBtnNum: PropNumShow;
//道具使用引导
propGuide: PropGuide;
start(data) { start(data) {
super.start(); super.start();
//初始化索引信息 //初始化索引信息
...@@ -263,7 +261,17 @@ export default class MainScene extends Scene { ...@@ -263,7 +261,17 @@ export default class MainScene extends Scene {
sucess.x = 474; sucess.x = 474;
sucess.y = 10; sucess.y = 10;
sucess.addEventListener(egret.TouchEvent.TOUCH_TAP, function () { sucess.addEventListener(egret.TouchEvent.TOUCH_TAP, function () {
this.submit(JSON.stringify({ 1: 0 })) var json = {};
json[1] = 99999;
if (this.passElements) {
//i就是元素类型的索引
for (var i = 0; i < this.passElements.length; i++) {
if (this.passElements[i] != undefined) {
json[submitTran[i]] = 999
}
}
}
this.submit(JSON.stringify(json))
}, this) }, this)
this.addChild(sucess) this.addChild(sucess)
} }
...@@ -301,7 +309,7 @@ export default class MainScene extends Scene { ...@@ -301,7 +309,7 @@ export default class MainScene extends Scene {
this.stepNumber.x = 123; this.stepNumber.x = 123;
this.stepNumber.y = 97; this.stepNumber.y = 97;
this.addChild(this.stepNumber); this.addChild(this.stepNumber);
//分数进度条 //分数进度条,托管
this.scoreProgress = new ScoreProgress(this.starProgress, this.scoreTxt, this.chapterData.starScores); this.scoreProgress = new ScoreProgress(this.starProgress, this.scoreTxt, this.chapterData.starScores);
//背景图生成 //背景图生成
// var bg = drawBg(this.chapterData.map.paths, this.chapterData.map.lattices) // var bg = drawBg(this.chapterData.map.paths, this.chapterData.map.lattices)
...@@ -347,10 +355,10 @@ export default class MainScene extends Scene { ...@@ -347,10 +355,10 @@ export default class MainScene extends Scene {
this[arrObj[i]].count = nums[i]; this[arrObj[i]].count = nums[i];
this.addChild(this[arrObj[i]]) this.addChild(this[arrObj[i]])
} }
//用一次发一次hc_home接口 //道具使用引导
// getPropNums(PropType.BOOM); this.propGuide = new PropGuide();
// getPropNums(PropType.HAMMER); this.propGuide.touchEnabled = true;
// getPropNums(PropType.CHANCE_NUM);
} }
//初始化格子 //初始化格子
initLattices() { initLattices() {
...@@ -622,7 +630,7 @@ export default class MainScene extends Scene { ...@@ -622,7 +630,7 @@ export default class MainScene extends Scene {
//购买弹框 //购买弹框
PanelCtrl.instance.show("Buy1") PanelCtrl.instance.show("Buy1")
} else { } else {
//弹出蒙层,点蒙层关闭,点击任意元素,去掉容器的事件 this.useProp(PropType.BOOM)
} }
} }
onTap_hammerBtn() { onTap_hammerBtn() {
...@@ -631,7 +639,7 @@ export default class MainScene extends Scene { ...@@ -631,7 +639,7 @@ export default class MainScene extends Scene {
//购买弹框 //购买弹框
PanelCtrl.instance.show("Buy2", {}) PanelCtrl.instance.show("Buy2", {})
} else { } else {
this.useProp(PropType.HAMMER)
} }
} }
onTap_stepBtn() { onTap_stepBtn() {
...@@ -640,16 +648,17 @@ export default class MainScene extends Scene { ...@@ -640,16 +648,17 @@ export default class MainScene extends Scene {
//购买弹框 //购买弹框
PanelCtrl.instance.show("Buy3", {}) PanelCtrl.instance.show("Buy3", {})
} else { } else {
this.useProp(PropType.CHANCE_NUM)
//再写,成功后请求home接口,然后执行updateScene //再写,成功后请求home接口,然后执行updateScene
NetManager.ins.hc_useProp((s) => { // NetManager.ins.hc_useProp((s) => {
if (s) { // if (s) {
} // }
}, PropType.CHANCE_NUM) // }, PropType.CHANCE_NUM)
} }
} }
//使用道具逻辑 //使用道具逻辑
useProp() { useProp(prop: PropType) {
//去掉移动提示侦听 //去掉移动提示侦听
this.removeEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this); this.removeEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
//去掉如果正在提示着的话 //去掉如果正在提示着的话
...@@ -657,10 +666,19 @@ export default class MainScene extends Scene { ...@@ -657,10 +666,19 @@ export default class MainScene extends Scene {
this.isShowWarning = false; this.isShowWarning = false;
this.resetWarning(); this.resetWarning();
} }
// //如果是炸弹或者锤子
} if (prop == PropType.BOOM || prop == PropType.HAMMER) {
//去掉元素容器的侦听
this.elementContainer.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.mouseDownE, this);
this.elementContainer.removeEventListener(egret.TouchEvent.TOUCH_MOVE, this.mouseMoveE, this);
//去掉如果有选中的元素
if (this.SELECTED && this.choosed.parent) {
this.choosed.parent.removeChild(this.choosed)
}
} else {
}
}
mouseDownE(e: egret.TextEvent) { mouseDownE(e: egret.TextEvent) {
// if (!this.enableTouch) return // if (!this.enableTouch) return
var self = this; var self = this;
...@@ -669,28 +687,13 @@ export default class MainScene extends Scene { ...@@ -669,28 +687,13 @@ export default class MainScene extends Scene {
this.isShowWarning = false; this.isShowWarning = false;
this.noActionCount = 0; this.noActionCount = 0;
this.resetWarning(); this.resetWarning();
// e.target.parent.isLock = true;
// e.target.parent.lockAni.play()
// var a=new ThreeCrossAni();
// a.x=e.target.parent.x;
// a.y=e.target.parent.y;
// this.addChild(a);
// a.play()
// console.log(e.target.parent)
// this.elementContainer.removeChild(e.target.parent)
// this.recoverEle(e.target.parent.index);
//是
if (e.target.parent.type == ElementType.ROCK || e.target.parent.isLock) return if (e.target.parent.type == ElementType.ROCK || e.target.parent.isLock) return
// console.log(e.target.parent) // console.log(e.target.parent)
if (self.SELECTED && Tool.checkNeb(e.target.parent, self.SELECTED)) { if (self.SELECTED && Tool.checkNeb(e.target.parent, self.SELECTED)) {
self.exchangeElementAni(self.SELECTED, e.target.parent, self.callbackEx); self.exchangeElementAni(self.SELECTED, e.target.parent, self.callbackEx);
// self.SELECTED.removeChild(self.choosed); self.SELECTED.removeChild(self.choosed);
self.SELECTED = null; self.SELECTED = null;
} else { } else {
// if (self.SELECTED) {
// self.SELECTED.removeChild(self.choosed);
// }
self.SELECTED = e.target.parent; self.SELECTED = e.target.parent;
if (self.SELECTED.effectType == EffectType.MAGICLION) { if (self.SELECTED.effectType == EffectType.MAGICLION) {
self.elementContainer.addChildAt(self.SELECTED, 0); self.elementContainer.addChildAt(self.SELECTED, 0);
...@@ -706,7 +709,7 @@ export default class MainScene extends Scene { ...@@ -706,7 +709,7 @@ export default class MainScene extends Scene {
if (e.target.parent.type == ElementType.ROCK || e.target.parent.isLock) return if (e.target.parent.type == ElementType.ROCK || e.target.parent.isLock) return
if (Tool.checkNeb(e.target.parent, this.SELECTED)) { if (Tool.checkNeb(e.target.parent, this.SELECTED)) {
this.exchangeElementAni(this.SELECTED, e.target.parent, this.callbackEx); this.exchangeElementAni(this.SELECTED, e.target.parent, this.callbackEx);
// this.SELECTED.removeChild(this.choosed); this.SELECTED.removeChild(this.choosed);
this.SELECTED = null; this.SELECTED = null;
} }
} }
...@@ -744,12 +747,10 @@ export default class MainScene extends Scene { ...@@ -744,12 +747,10 @@ export default class MainScene extends Scene {
var self = this; var self = this;
// self.enableTouch = false; // self.enableTouch = false;
this.enableMouseEvt(false); this.enableMouseEvt(false);
// s.removeChild(self.choosed);
egret.Tween.get(s) egret.Tween.get(s)
.to({ x: o.x, y: o.y }, 166) .to({ x: o.x, y: o.y }, 166)
.call(() => { .call(() => {
if (callback) { if (callback) {
s.removeChild(self.choosed);
callback.bind(self)(s, o); callback.bind(self)(s, o);
} else { } else {
// self.enableTouch = true; // self.enableTouch = true;
...@@ -2205,10 +2206,7 @@ export default class MainScene extends Scene { ...@@ -2205,10 +2206,7 @@ export default class MainScene extends Scene {
} }
this.enableTouch = b; this.enableTouch = b;
} }
sample() { sample() {
var parser = new window["SVGA"].Parser(); var parser = new window["SVGA"].Parser();
parser.load("../egret/loading五神兽最终版.svga", (videoItem) => { parser.load("../egret/loading五神兽最终版.svga", (videoItem) => {
var mv = new window["SVGA"].EgretMovieClip(videoItem) var mv = new window["SVGA"].EgretMovieClip(videoItem)
...@@ -2229,6 +2227,4 @@ export default class MainScene extends Scene { ...@@ -2229,6 +2227,4 @@ export default class MainScene extends Scene {
alert(error.message); alert(error.message);
}) })
} }
} }
\ No newline at end of file
...@@ -37,7 +37,7 @@ export class BonusShootAni extends egret.DisplayObjectContainer { ...@@ -37,7 +37,7 @@ export class BonusShootAni extends egret.DisplayObjectContainer {
this.reset() this.reset()
this.shoot.rotation = rotation; this.shoot.rotation = rotation;
egret.Tween.get(this) egret.Tween.get(this)
.to({ x: p[0], y: p[1] }, 400) .to({ x: p[0], y: p[1] }, 300)
.call(() => { .call(() => {
callback(); callback();
this.shoot.visible = false; this.shoot.visible = false;
......
import PropType from "../../PropType";
/**
* 道具使用引导,初始化一次,然后用init初始化
* 185.58-67,1100-60
* 375.5-67.5
* 568.46-67.5
*/
export class PropGuide extends egret.DisplayObjectContainer {
bg: egret.Shape;
boomBtn: egret.Bitmap;
hammerBtn: egret.Bitmap;
stepBtn: egret.Bitmap;
msgTxt: egret.TextField;
constructor() {
super()
this.bg = new egret.Shape();
this.addChild(this.bg);
this.boomBtn = new egret.Bitmap(RES.getRes("boomBtn_png"));
this.boomBtn.x = 185.58 - 67;
this.boomBtn.y = 1100 - 60;
this.addChild(this.boomBtn);
this.hammerBtn = new egret.Bitmap(RES.getRes("hammerBtn_png"));
this.hammerBtn.x = 375.5 - 67.5;
this.hammerBtn.y = 1100 - 60;
this.addChild(this.hammerBtn);
this.stepBtn = new egret.Bitmap(RES.getRes("stepBtn_png"));
this.stepBtn.x = 568.46 - 67.5;
this.stepBtn.y = 1100 - 60;
this.addChild(this.stepBtn);
//再调
var text: egret.TextField = new egret.TextField();
text.text = "为本次增加额外5次步数";
text.textColor = 0xffffff;
text.size = 20;
text.x = (750-500)/2;
text.y = 1008;
text.textAlign = egret.HorizontalAlign.CENTER;
text.width = 500;
this.addChild(text);
this.msgTxt = text;
this.addEventListener(egret.TouchEvent.TOUCH_TAP, () => {
if (this.parent) this.parent.removeChild(this)
}, this)
}
init(prop: PropType) {
if (prop == PropType.BOOM) {
this.boomBtn.visible = true;
this.hammerBtn.visible = false;
this.stepBtn.visible = false;
this.setRect();
this.msgTxt.text = "选择任意一个元素,它的横竖各一排消除";
// this.msgTxt.x = (750-500)/2;
}
else if (prop == PropType.HAMMER) {
this.boomBtn.visible = false;
this.hammerBtn.visible = true;
this.stepBtn.visible = false;
this.setRect();
this.msgTxt.text = "选择任意一个元素即可消除";
// this.msgTxt.x = (750-500)/2;
}
else {
this.boomBtn.visible = false;
this.hammerBtn.visible = false;
this.stepBtn.visible = true;
this.bg.graphics.clear();
this.bg.graphics.beginFill(0x000000, 0.7)
this.bg.graphics.moveTo(0, 0);
this.bg.graphics.lineTo(750, 0);
this.bg.graphics.lineTo(750, 1624);
this.bg.graphics.lineTo(0, 1624);
this.bg.graphics.lineTo(0, 0);
this.bg.graphics.drawArc(123, 98, 72, 0, Math.PI * 2, true)
this.bg.graphics.endFill();
this.msgTxt.text = "为本次增加额外5次步数";
// this.msgTxt.x = 320;
}
}
setRect() {
this.bg.graphics.clear();
this.bg.graphics.beginFill(0x000000, 0.7)
this.bg.graphics.moveTo(0, 0);
this.bg.graphics.lineTo(750, 0);
this.bg.graphics.lineTo(750, 1624);
this.bg.graphics.lineTo(0, 1624);
this.bg.graphics.lineTo(0, 0);
this.bg.graphics.moveTo(15, 275);
this.bg.graphics.lineTo(15, 990);
this.bg.graphics.lineTo(750 - 15, 990);
this.bg.graphics.lineTo(750 - 15, 275);
this.bg.graphics.lineTo(15, 275);
this.bg.graphics.endFill();
}
}
\ No newline at end of file
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