Commit 27e7d2fc authored by wildfirecode's avatar wildfirecode

1

parent ef861fa8
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"mainScene","version":5,"files":["../assets/mainScene/yezi1.png","../assets/mainScene/unlightedStar.png","../assets/mainScene/targetBoard.png","../assets/mainScene/stepsBoard.png","../assets/mainScene/stepNumber9.png","../assets/mainScene/stepNumber8.png","../assets/mainScene/stepNumber7.png","../assets/mainScene/stepNumber6.png","../assets/mainScene/stepNumber5.png","../assets/mainScene/stepNumber4.png","../assets/mainScene/stepNumber3.png","../assets/mainScene/stepNumber2.png","../assets/mainScene/stepNumber1.png","../assets/mainScene/stepNumber0.png","../assets/mainScene/stepBtn.png","../assets/mainScene/starProgress.png","../assets/mainScene/setting.png","../assets/mainScene/scoreNumber9.png","../assets/mainScene/scoreNumber8.png","../assets/mainScene/scoreNumber7.png","../assets/mainScene/scoreNumber6.png","../assets/mainScene/scoreNumber5.png","../assets/mainScene/scoreNumber4.png","../assets/mainScene/scoreNumber3.png","../assets/mainScene/scoreNumber2.png","../assets/mainScene/scoreNumber1.png","../assets/mainScene/scoreNumber0.png","../assets/mainScene/rock6.png","../assets/mainScene/rock5.png","../assets/mainScene/rock4.png","../assets/mainScene/rock3.png","../assets/mainScene/rock2.png","../assets/mainScene/rock1.png","../assets/mainScene/rightMark.png","../assets/mainScene/rightArrow.png","../assets/mainScene/rectLat.png","../assets/mainScene/progressDown.png","../assets/mainScene/playSceneBg.png","../assets/mainScene/magicLionBg.png","../assets/mainScene/magicLion.png","../assets/mainScene/lockUp.png","../assets/mainScene/lockDown.png","../assets/mainScene/lineLight.png","../assets/mainScene/lightedStar.png","../assets/mainScene/leftArrow.png","../assets/mainScene/ice6.png","../assets/mainScene/ice5.png","../assets/mainScene/ice4.png","../assets/mainScene/ice3.png","../assets/mainScene/ice2.png","../assets/mainScene/ice1.png","../assets/mainScene/hammerBtn.png","../assets/mainScene/eleDis9.png","../assets/mainScene/eleDis8.png","../assets/mainScene/eleDis7.png","../assets/mainScene/eleDis6.png","../assets/mainScene/eleDis5.png","../assets/mainScene/eleDis4.png","../assets/mainScene/eleDis3.png","../assets/mainScene/eleDis2.png","../assets/mainScene/eleDis12.png","../assets/mainScene/eleDis11.png","../assets/mainScene/eleDis10.png","../assets/mainScene/eleDis1.png","../assets/mainScene/ele5.png","../assets/mainScene/ele42.png","../assets/mainScene/ele41.png","../assets/mainScene/ele40.png","../assets/mainScene/ele4.png","../assets/mainScene/ele32.png","../assets/mainScene/ele31.png","../assets/mainScene/ele30.png","../assets/mainScene/ele3.png","../assets/mainScene/ele22.png","../assets/mainScene/ele21.png","../assets/mainScene/ele20.png","../assets/mainScene/ele2.png","../assets/mainScene/ele12.png","../assets/mainScene/ele11.png","../assets/mainScene/ele10.png","../assets/mainScene/ele1.png","../assets/mainScene/ele02.png","../assets/mainScene/ele01.png","../assets/mainScene/ele00.png","../assets/mainScene/ele0.png","../assets/mainScene/dangqianfenshu.png","../assets/mainScene/chooseRect.png","../assets/mainScene/boomBtn.png","../assets/mainScene/boom9.png","../assets/mainScene/boom8.png","../assets/mainScene/boom7.png","../assets/mainScene/boom6.png","../assets/mainScene/boom5.png","../assets/mainScene/boom4.png","../assets/mainScene/boom3.png","../assets/mainScene/boom2.png","../assets/mainScene/boom18.png","../assets/mainScene/boom17.png","../assets/mainScene/boom16.png","../assets/mainScene/boom15.png","../assets/mainScene/boom14.png","../assets/mainScene/boom13.png","../assets/mainScene/boom12.png","../assets/mainScene/boom11.png","../assets/mainScene/boom10.png","../assets/mainScene/boom1.png","../assets/mainScene/mainSoundBtnOn.png","../assets/mainScene/mainSettingBg.png","../assets/mainScene/mainQuestionBtn.png","../assets/mainScene/mainMusicBtnOn.png","../assets/mainScene/mainQuitBtn.png","../assets/mainScene/mainSoundBtnOff.png","../assets/mainScene/mainMusicBtnOff.png","../assets/mainScene/targetNumber9.png","../assets/mainScene/targetNumber8.png","../assets/mainScene/targetNumber7.png","../assets/mainScene/targetNumber6.png","../assets/mainScene/targetNumber5.png","../assets/mainScene/targetNumber4.png","../assets/mainScene/targetNumber3.png","../assets/mainScene/targetNumber2.png","../assets/mainScene/targetNumber1.png","../assets/mainScene/targetNumber0.png","../assets/mainScene/ele7.png","../assets/mainScene/ele6.png","../assets/mainScene/bonusFra9.png","../assets/mainScene/bonusFra8.png","../assets/mainScene/bonusFra7.png","../assets/mainScene/bonusFra6.png","../assets/mainScene/bonusFra5.png","../assets/mainScene/bonusFra4.png","../assets/mainScene/bonusFra3.png","../assets/mainScene/bonusFra27.png","../assets/mainScene/bonusFra26.png","../assets/mainScene/bonusFra25.png","../assets/mainScene/bonusFra24.png","../assets/mainScene/bonusFra23.png","../assets/mainScene/bonusFra22.png","../assets/mainScene/bonusFra21.png","../assets/mainScene/bonusFra20.png","../assets/mainScene/bonusFra2.png","../assets/mainScene/bonusFra19.png","../assets/mainScene/bonusFra18.png","../assets/mainScene/bonusFra17.png","../assets/mainScene/bonusFra16.png","../assets/mainScene/bonusFra15.png","../assets/mainScene/bonusFra14.png","../assets/mainScene/bonusFra13.png","../assets/mainScene/bonusFra12.png","../assets/mainScene/bonusFra11.png","../assets/mainScene/bonusFra10.png","../assets/mainScene/bonusFra1.png","../assets/mainScene/bonusShoot.png","../assets/mainScene/guideTxt5.png","../assets/mainScene/guideTxt4.png","../assets/mainScene/guideTxt3.png","../assets/mainScene/guideTxt2.png","../assets/mainScene/guideTxt1.png","../assets/mainScene/guideKnowBtn.png","../assets/mainScene/guideBg.png","../assets/mainScene/propNum9.png","../assets/mainScene/propNum8.png","../assets/mainScene/propNum7.png","../assets/mainScene/propNum6.png","../assets/mainScene/propNum5.png","../assets/mainScene/propNum4.png","../assets/mainScene/propNum3.png","../assets/mainScene/propNum2.png","../assets/mainScene/propNum1.png","../assets/mainScene/propNum0.png","../assets/mainScene/propNumBg.png"]}
\ No newline at end of file
...@@ -86,11 +86,14 @@ ...@@ -86,11 +86,14 @@
</e:skinName> </e:skinName>
</e:Button> </e:Button>
</e:Group> </e:Group>
<e:Group id="boxani" x="19" y="251" visible="false"> <e:Group id="boxLayer" x="0" y="0" visible="false">
<e:Rect width="750" height="1624" fillAlpha="0.7" x="0" y="0"/>
<e:Group id="boxani" x="19" y="251">
<e:Image id="lightbg" source="光 副本 4_png" y="0" x="0"/> <e:Image id="lightbg" source="光 副本 4_png" y="0" x="0"/>
<e:Image id="boxFrame1" source="宝箱1_png" x="156" y="95"/> <e:Image id="boxFrame1" source="宝箱1_png" x="156" y="95"/>
<e:Image id="boxFrame2" source="宝箱2_png" x="69.06" y="32.7"/> <e:Image id="boxFrame2" source="宝箱2_png" x="69.06" y="32.7"/>
<e:Image id="boxFrame3" source="宝箱3_png" x="68.78" y="-30.72"/> <e:Image id="boxFrame3" source="宝箱3_png" x="68.78" y="-30.72"/>
</e:Group> </e:Group>
</e:Group>
<w:Config id="16c89f4ae1a"/> <w:Config id="16c89f4ae1a"/>
</e:Skin> </e:Skin>
\ No newline at end of file
import { DataManager } from "../libs/tw/manager/DataManager"; import { DataManager } from "../libs/tw/manager/DataManager";
interface IHomeData { interface IHomeData {
levels:{levelNum,maxScore,stars}[]; levels:{levelNum,maxScore,stars}[];
totalStarts; totalStars;
canReceiveTreasureBoxNum; canReceiveTreasureBoxNum;
wealth; wealth;
remainEnargy; remainEnargy;
......
...@@ -9,6 +9,7 @@ import MapBottomPart from "./MapBottomPart"; ...@@ -9,6 +9,7 @@ import MapBottomPart from "./MapBottomPart";
import MapRpeatPart from "./MapRpeatPart"; import MapRpeatPart from "./MapRpeatPart";
import MapTopPart from "./MapTopPart"; import MapTopPart from "./MapTopPart";
import { DataManager } from "../../libs/tw/manager/DataManager"; import { DataManager } from "../../libs/tw/manager/DataManager";
import wait from "../../libs/new_tc/wait";
export default class MapScene extends Scene { export default class MapScene extends Scene {
scrollGroup: eui.Group; scrollGroup: eui.Group;
...@@ -74,7 +75,7 @@ export default class MapScene extends Scene { ...@@ -74,7 +75,7 @@ export default class MapScene extends Scene {
updateBox() { updateBox() {
const homeData = getHomeData(); const homeData = getHomeData();
this['boxiconWrapper'].visible = homeData.canReceiveTreasureBoxNum > 0; this['boxiconWrapper'].visible = homeData.canReceiveTreasureBoxNum > 0;
this['totalStarTxt'].text = `${homeData.totalStarts}/${homeData.canReceiveTreasureBoxNum}`; this['totalStarTxt'].text = `${homeData.totalStars}/${homeData.canReceiveTreasureBoxNum}`;
this['boxNumsTxt'].text = `${homeData.canReceiveTreasureBoxNum}`; this['boxNumsTxt'].text = `${homeData.canReceiveTreasureBoxNum}`;
} }
...@@ -107,21 +108,46 @@ export default class MapScene extends Scene { ...@@ -107,21 +108,46 @@ export default class MapScene extends Scene {
this['settingBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.toggleSettings, this) this['settingBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.toggleSettings, this)
this['shopBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_shopBtn, this) this['shopBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_shopBtn, this)
this['questionBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_questionBtn, this); this['questionBtn'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_questionBtn, this);
this['box'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_box, this); this['box'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_boxLayer, this);
} this['boxani'].addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap_box, this);
}
onTap_box() {
onTap_boxLayer() {
this['boxLayer'].visible = true;
this['boxFrame1'].visible=true;
this['boxFrame2'].visible=false;
this['boxFrame3'].visible=false;
}
async playAni() {
this['boxFrame1'].visible=true;
this['boxFrame2'].visible=false;
this['boxFrame3'].visible=false;
await wait(1000/10);
this['boxFrame1'].visible=false;
this['boxFrame2'].visible=true;
this['boxFrame3'].visible=false;
await wait(1000/10);
this['boxFrame1'].visible=false;
this['boxFrame2'].visible=false;
this['boxFrame3'].visible=true;
await wait(300);
this['boxLayer'].visible = false;
}
async onTap_box() {
const data = getHomeData(); const data = getHomeData();
if (data.canReceiveTreasureBoxNum > 0) { if (data.canReceiveTreasureBoxNum > 0) {
await this.playAni();
this['box'].touchEnabled = false; this['box'].touchEnabled = false;
NetManager.ins.hc_openTreasureBox((success) => { NetManager.ins.hc_openTreasureBox((success) => {
this['box'].touchEnabled = true; this['box'].touchEnabled = true;
if(success) { if (success) {
const boxdata = DataManager.ins.getData('hc_openTreasureBox').data; const boxdata = DataManager.ins.getData('hc_openTreasureBox').data;
const homeData = DataManager.ins.getData('hc_home').data; const homeData = DataManager.ins.getData('hc_home').data;
homeData.canReceiveTreasureBoxNum=boxdata.canReceiveTreasureBoxNum; homeData.canReceiveTreasureBoxNum = boxdata.canReceiveTreasureBoxNum;
homeData.nextRangeStarsNum=boxdata.nextRangeStarsNum; homeData.nextRangeStarsNum = boxdata.nextRangeStarsNum;
homeData.totalStarts=boxdata.totalStarts; homeData.totalStarts = boxdata.totalStarts;
this.updateBox(); this.updateBox();
} }
}) })
......
{ {
"code":"0000000000", "success": true,
"data":{ "code": "0000000000",
"askForEnergy":true, "desc": "OK",
"canReceiveTreasureBoxNum":10, "timestamp": 1566457832261,
"nextRangeStarsNum":10, "data": {
"remainEnargy":11, "wealth": 0,
"remainProp" :[ "totalStars": 0,
{"type":1,"num":1}, "levels": [],
{"type":2,"num":2} "remainProp": [],
], "remainEnargy": 5,
"levels":[ "askForEnergy": false,
{ "canReceiveTreasureBoxNum": 0,
"levelNum":1, "nextRangeStarsNum": 10
"maxScore":23,
"stars":3
},
{
"levelNum":3,
"maxScore":23,
"stars":1
},
{
"levelNum":2,
"maxScore":45,
"stars":2
} }
],
"switchConf":[
{
"status":1,
"type":1
},
{
"status":1,
"type":2
}
],
"totalStarts":15,
"wealth":5
},
"desc":"OK",
"success":true,
"timestamp":1565752605970
} }
\ 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