Commit b41db497 authored by haiyoucuv's avatar haiyoucuv

111

parent d3971b8e
...@@ -2,10 +2,36 @@ ...@@ -2,10 +2,36 @@
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="9cef0552-af3c-4a1c-be1f-dc41ebe5b6db" name="Default Changelist" comment=""> <list default="true" id="9cef0552-af3c-4a1c-be1f-dc41ebe5b6db" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/resource/map/map_whale_0.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/map/map_whale_1.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/map/map_whale_10.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/map/map_whale_11.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/map/map_whale_12.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/map/map_whale_2.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/map/map_whale_3.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/map/map_whale_4.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/map/map_whale_5.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/map/map_whale_6.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/map/map_whale_7.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/map/map_whale_8.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/map/map_whale_9.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/map/water1.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resource/map/water2.png" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/panels/StartPanelPrize.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/libs/FYGE.d.ts" beforeDir="false" afterPath="$PROJECT_DIR$/libs/FYGE.d.ts" afterDir="false" /> <change beforePath="$PROJECT_DIR$/mock/miniTb/babycare.getIndex.json" beforeDir="false" afterPath="$PROJECT_DIR$/mock/miniTb/babycare.getIndex.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resource/StartPanel/开始闯关不要能量.png" beforeDir="false" afterPath="$PROJECT_DIR$/resource/common/开始闯关不要能量.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resource/map/map_bg2.jpg" beforeDir="false" afterPath="$PROJECT_DIR$/resource/map/map_bg2.jpg" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resource/res.json" beforeDir="false" afterPath="$PROJECT_DIR$/resource/res.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Main.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/Main.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/ResJson.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/ResJson.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/SkinJson.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/SkinJson.ts" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/SkinJson.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/SkinJson.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/panels/StartPanel.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/panels/StartPanel.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/scene/PlayScene.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/scene/PlayScene.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/scene/map/CheckBtn.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/scene/map/CheckBtn.ts" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/scene/map/CheckBtn.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/scene/map/CheckBtn.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/scene/map/MapMid.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/scene/map/MapMid.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/scene/map/MapScene.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/scene/map/MapScene.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/scene/map/MapUI.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/scene/map/MapUI.ts" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
...@@ -35,7 +61,7 @@ ...@@ -35,7 +61,7 @@
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" /> <property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" /> <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" /> <property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/mock" /> <property name="last_opened_file_path" value="$PROJECT_DIR$/resource/map" />
<property name="node.js.detected.package.tslint" value="true" /> <property name="node.js.detected.package.tslint" value="true" />
<property name="node.js.path.for.package.tslint" value="project" /> <property name="node.js.path.for.package.tslint" value="project" />
<property name="node.js.selected.package.tslint" value="(autodetect)" /> <property name="node.js.selected.package.tslint" value="(autodetect)" />
...@@ -47,15 +73,16 @@ ...@@ -47,15 +73,16 @@
<property name="ts.external.directory.path" value="$PROJECT_DIR$/node_modules/typescript/lib" /> <property name="ts.external.directory.path" value="$PROJECT_DIR$/node_modules/typescript/lib" />
</component> </component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/src/scene/map" />
</key>
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/mock" />
<recent name="$PROJECT_DIR$/resource/map" /> <recent name="$PROJECT_DIR$/resource/map" />
<recent name="$PROJECT_DIR$/mock" />
<recent name="$PROJECT_DIR$/libs" /> <recent name="$PROJECT_DIR$/libs" />
<recent name="$PROJECT_DIR$/resource" /> <recent name="$PROJECT_DIR$/resource" />
</key> </key>
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/resource/common" />
<recent name="$PROJECT_DIR$/src/scene/map" />
</key>
</component> </component>
<component name="RunManager" selected="npm.dev"> <component name="RunManager" selected="npm.dev">
<configuration name="dev" type="js.build_tools.npm" temporary="true" nameIsGenerated="true"> <configuration name="dev" type="js.build_tools.npm" temporary="true" nameIsGenerated="true">
...@@ -98,7 +125,7 @@ ...@@ -98,7 +125,7 @@
<workItem from="1594106517562" duration="5224000" /> <workItem from="1594106517562" duration="5224000" />
<workItem from="1594111755267" duration="29551000" /> <workItem from="1594111755267" duration="29551000" />
<workItem from="1594260676967" duration="30060000" /> <workItem from="1594260676967" duration="30060000" />
<workItem from="1594604662575" duration="5635000" /> <workItem from="1594604662575" duration="27176000" />
</task> </task>
<task id="LOCAL-00001" summary="111"> <task id="LOCAL-00001" summary="111">
<created>1594122339119</created> <created>1594122339119</created>
...@@ -158,22 +185,22 @@ ...@@ -158,22 +185,22 @@
<screen x="31" y="23" width="1889" height="1177" /> <screen x="31" y="23" width="1889" height="1177" />
</state> </state>
<state x="58" y="183" key="CommitChangelistDialog2/31.23.1889.1177@31.23.1889.1177" timestamp="1594303577069" /> <state x="58" y="183" key="CommitChangelistDialog2/31.23.1889.1177@31.23.1889.1177" timestamp="1594303577069" />
<state width="879" height="329" key="GridCell.Tab.0.bottom" timestamp="1594605745156"> <state width="882" height="329" key="GridCell.Tab.0.bottom" timestamp="1594643554502">
<screen x="31" y="23" width="1889" height="1177" /> <screen x="31" y="23" width="1889" height="1177" />
</state> </state>
<state width="879" height="329" key="GridCell.Tab.0.bottom/31.23.1889.1177@31.23.1889.1177" timestamp="1594605745156" /> <state width="882" height="329" key="GridCell.Tab.0.bottom/31.23.1889.1177@31.23.1889.1177" timestamp="1594643554502" />
<state width="879" height="329" key="GridCell.Tab.0.center" timestamp="1594605745155"> <state width="882" height="329" key="GridCell.Tab.0.center" timestamp="1594643554497">
<screen x="31" y="23" width="1889" height="1177" /> <screen x="31" y="23" width="1889" height="1177" />
</state> </state>
<state width="879" height="329" key="GridCell.Tab.0.center/31.23.1889.1177@31.23.1889.1177" timestamp="1594605745155" /> <state width="882" height="329" key="GridCell.Tab.0.center/31.23.1889.1177@31.23.1889.1177" timestamp="1594643554497" />
<state width="879" height="329" key="GridCell.Tab.0.left" timestamp="1594605745155"> <state width="882" height="329" key="GridCell.Tab.0.left" timestamp="1594643554496">
<screen x="31" y="23" width="1889" height="1177" /> <screen x="31" y="23" width="1889" height="1177" />
</state> </state>
<state width="879" height="329" key="GridCell.Tab.0.left/31.23.1889.1177@31.23.1889.1177" timestamp="1594605745155" /> <state width="882" height="329" key="GridCell.Tab.0.left/31.23.1889.1177@31.23.1889.1177" timestamp="1594643554496" />
<state width="879" height="329" key="GridCell.Tab.0.right" timestamp="1594605745156"> <state width="882" height="329" key="GridCell.Tab.0.right" timestamp="1594643554497">
<screen x="31" y="23" width="1889" height="1177" /> <screen x="31" y="23" width="1889" height="1177" />
</state> </state>
<state width="879" height="329" key="GridCell.Tab.0.right/31.23.1889.1177@31.23.1889.1177" timestamp="1594605745156" /> <state width="882" height="329" key="GridCell.Tab.0.right/31.23.1889.1177@31.23.1889.1177" timestamp="1594643554497" />
<state x="210" y="320" key="RollbackChangesDialog" timestamp="1594173186663"> <state x="210" y="320" key="RollbackChangesDialog" timestamp="1594173186663">
<screen x="31" y="23" width="1889" height="1177" /> <screen x="31" y="23" width="1889" height="1177" />
</state> </state>
...@@ -202,13 +229,17 @@ ...@@ -202,13 +229,17 @@
<screen x="31" y="23" width="1889" height="1177" /> <screen x="31" y="23" width="1889" height="1177" />
</state> </state>
<state x="805" y="23" width="879" height="1158" key="dock-window-3/31.23.1889.1177@31.23.1889.1177" timestamp="1594604843980" /> <state x="805" y="23" width="879" height="1158" key="dock-window-3/31.23.1889.1177@31.23.1889.1177" timestamp="1594604843980" />
<state x="222" y="390" key="refactoring.ChangeSignatureDialog" timestamp="1594631868193">
<screen x="31" y="23" width="1889" height="1177" />
</state>
<state x="222" y="390" key="refactoring.ChangeSignatureDialog/31.23.1889.1177@31.23.1889.1177" timestamp="1594631868193" />
<state x="157" y="286" key="run.anything.popup" timestamp="1594188122355"> <state x="157" y="286" key="run.anything.popup" timestamp="1594188122355">
<screen x="31" y="23" width="1889" height="1177" /> <screen x="31" y="23" width="1889" height="1177" />
</state> </state>
<state x="157" y="286" key="run.anything.popup/31.23.1889.1177@31.23.1889.1177" timestamp="1594188122355" /> <state x="157" y="286" key="run.anything.popup/31.23.1889.1177@31.23.1889.1177" timestamp="1594188122355" />
<state x="640" y="288" width="670" height="676" key="search.everywhere.popup" timestamp="1594609774151"> <state x="640" y="288" width="670" height="676" key="search.everywhere.popup" timestamp="1594632955275">
<screen x="31" y="23" width="1889" height="1177" /> <screen x="31" y="23" width="1889" height="1177" />
</state> </state>
<state x="640" y="288" width="670" height="676" key="search.everywhere.popup/31.23.1889.1177@31.23.1889.1177" timestamp="1594609774151" /> <state x="640" y="288" width="670" height="676" key="search.everywhere.popup/31.23.1889.1177@31.23.1889.1177" timestamp="1594632955275" />
</component> </component>
</project> </project>
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"message": "OK", "message": "OK",
"data": { "data": {
"power": 100, "power": 100,
"currentLevel": 4, "currentLevel": 120,
"tools": { "tools": {
"STEPS": 1, "STEPS": 1,
"BOOMS": 2, "BOOMS": 2,
...@@ -14,6 +14,9 @@ ...@@ -14,6 +14,9 @@
{ {
"level": 5 "level": 5
}, },
{
"level": 4
},
{ {
"level": 1 "level": 1
} }
...@@ -45,7 +48,56 @@ ...@@ -45,7 +48,56 @@
"scores": 44444, "scores": 44444,
"stars": 2, "stars": 2,
"isPrizeLevel": false, "isPrizeLevel": false,
"isVisitSuccess": false "isVisitSuccess": true
},
{
"level": 5,
"scores": 44444,
"stars": 2,
"isPrizeLevel": false,
"isVisitSuccess": true
},
{
"level": 6,
"scores": 44444,
"stars": 2,
"isPrizeLevel": false,
"isVisitSuccess": true
},
{
"level": 7,
"scores": 44444,
"stars": 2,
"isPrizeLevel": false,
"isVisitSuccess": true
},
{
"level": 4,
"scores": 44444,
"stars": 2,
"isPrizeLevel": false,
"isVisitSuccess": true
},
{
"level": 8,
"scores": 44444,
"stars": 2,
"isPrizeLevel": false,
"isVisitSuccess": true
},
{
"level": 9,
"scores": 44444,
"stars": 2,
"isPrizeLevel": false,
"isVisitSuccess": true
},
{
"level": 10,
"scores": 44444,
"stars": 2,
"isPrizeLevel": false,
"isVisitSuccess": true
} }
], ],
"isFristLogin": false "isFristLogin": false
......
This diff is collapsed.
...@@ -78,8 +78,8 @@ export class Main { ...@@ -78,8 +78,8 @@ export class Main {
//隐藏加载中 //隐藏加载中
// if (document.getElementById("__loading__")) document.getElementById("__loading__").style.display = "none"; // if (document.getElementById("__loading__")) document.getElementById("__loading__").style.display = "none";
//打开开始场景 //打开开始场景
// changeScene(MapScene); changeScene(MapScene);
changeScene(PlayScene); // changeScene(PlayScene);
// changeScene(SStartScene); // changeScene(SStartScene);
// changeScene(StoryScene); // changeScene(StoryScene);
// changeScene(AdoptScene); // changeScene(AdoptScene);
......
This diff is collapsed.
...@@ -462,16 +462,6 @@ export const SkinJson = { ...@@ -462,16 +462,6 @@ export const SkinJson = {
"tUp": "关闭按钮.png" "tUp": "关闭按钮.png"
}, },
"id": "closeBtn" "id": "closeBtn"
},
{
"name": "动物",
"x": 154,
"y": 693,
"alpha": 1,
"type": "sprite",
"props": {
"source": "动物.png"
}
} }
] ]
}, },
...@@ -520,25 +510,26 @@ export const SkinJson = { ...@@ -520,25 +510,26 @@ export const SkinJson = {
"id": "tipsTex" "id": "tipsTex"
}, },
{ {
"name": "动物", "name": "开始闯关要能量",
"x": 154, "x": 163,
"y": 692, "y": 1120,
"alpha": 1, "alpha": 1,
"type": "sprite", "type": "button",
"props": { "props": {
"source": "动物.png" "tUp": "开始闯关要能量.png"
} },
"id": "startBtn"
}, },
{ {
"name": "开始闯关要能量", "name": "开始闯关要能量",
"x": 163, "x": 163,
"y": 1120, "y": 1120,
"alpha": 1, "alpha": 1,
"type": "button", "type": "button",
"props": { "props": {
"tUp": "开始闯关要能量.png" "tUp": "开始闯关要能量.png"
}, },
"id": "startBtn" "id": "startBtn2"
}, },
{ {
"name": "prize", "name": "prize",
......
import { Panel } from "../../module/views/Panel"; import { Panel } from "../../module/views/Panel";
import TEXT_ALIGN = FYGE.TEXT_ALIGN;
import { getChapterData } from "../something/chapters/getChapter"; import { getChapterData } from "../something/chapters/getChapter";
import { Tools } from "../Tools";
import { ElementTargetData } from "../something/interface/ElementTargetData";
import Container = FYGE.Container; import Container = FYGE.Container;
import TEXT_ALIGN = FYGE.TEXT_ALIGN;
import MouseEvent = FYGE.MouseEvent;
import { changeScene } from "../../module/ctrls";
import { PlayScene } from "../scene/PlayScene";
export class StartPanel extends Panel { export class StartPanel extends Panel {
get groupNames() { get groupNames() {
...@@ -22,24 +27,45 @@ export class StartPanel extends Panel { ...@@ -22,24 +27,45 @@ export class StartPanel extends Panel {
this.checkTex.textWidth = 750; this.checkTex.textWidth = 750;
this.checkTex.textAlign = TEXT_ALIGN.CENTER; this.checkTex.textAlign = TEXT_ALIGN.CENTER;
this.checkTex.x = 0; this.checkTex.x = 0;
this.checkTex.text = `第 ${this.data.check} 关`; this.checkTex.text = `第 ${this.data.level} 关`;
this.startBtn.visible = !this.data.isPlayed;
this.startBtn2.visible = this.data.isPlayed;
this.addChild(new StartTarget(this.data.level))
.position.set(0, 682);
this.addChild(new StartTarget(this.data.check)); this.tipsTex.visible = this.data.stars < 3;
} }
start(data) { start(data) {
super.start(); super.start();
} }
private startGame() {
changeScene(PlayScene, {chapter: this.data.level});
this.hidePanel();
}
initEvents() { initEvents() {
super.initEvents(); super.initEvents();
this.startBtn.addEventListener(MouseEvent.CLICK, this.startGame, this);
this.startBtn2.addEventListener(MouseEvent.CLICK, this.startGame, this);
} }
removeEvents() { removeEvents() {
super.removeEvents(); super.removeEvents();
this.startBtn.removeEventListener(MouseEvent.CLICK, this.startGame, this);
this.startBtn2.removeEventListener(MouseEvent.CLICK, this.startGame, this);
} }
} }
const pos = [
[325],
[240, 410],
[180, 325, 470],
]
export class StartTarget extends Container { export class StartTarget extends Container {
constructor(checkNum: number) { constructor(checkNum: number) {
super(); super();
...@@ -48,8 +74,28 @@ export class StartTarget extends Container { ...@@ -48,8 +74,28 @@ export class StartTarget extends Container {
if (passTarget.type == 0) { // 分数 if (passTarget.type == 0) { // 分数
} else if (passTarget.type == 1) { // 消除元素个数 } else if (passTarget.type == 1) { // 消除元素个数
passTarget.elements.forEach((v, i) => {
this.addChild(new StartTargetItem(v)).x = pos[passTarget.elements.length - 1][i];
});
} }
} }
} }
export class StartTargetItem extends Container {
constructor(data: ElementTargetData) {
super();
const targetImg = this.addChild(Tools.getSprite(`ele${data.type}.png`));
targetImg.width = targetImg.height = 100;
const targetTex = this.addChild(Tools.getText(
`${data.count}`, 30, '#ffffff',
TEXT_ALIGN.CENTER, 100, 0, 108
));
targetTex.strokeColor = '#eb5b57';
targetTex.stroke = 3;
}
}
import { Panel } from "../../module/views/Panel";
import MouseEvent = FYGE.MouseEvent;
import { changeScene } from "../../module/ctrls";
import { PlayScene } from "../scene/PlayScene";
import { StartTarget } from "./StartPanel";
import TEXT_ALIGN = FYGE.TEXT_ALIGN;
export class StartPanelPrize extends Panel {
get groupNames() {
return ["StartPanelPrize"]
}
get skinName() {
return "StartPanelPrize"
}
closeBtn: FYGE.Button;
startBtn: FYGE.Button;
startBtn2: FYGE.Button;
tipsTex: FYGE.TextField;
checkTex: FYGE.TextField;
initUi() {
this.checkTex.textWidth = 750;
this.checkTex.textAlign = TEXT_ALIGN.CENTER;
this.checkTex.x = 0;
this.checkTex.text = `第 ${this.data.level} 关`;
this.startBtn.visible = !this.data.isPlayed;
this.startBtn2.visible = this.data.isPlayed;
this.addChild(new StartTarget(this.data.level))
.position.set(0, 682);
}
start(data) {
super.start();
}
private startGame() {
changeScene(PlayScene, {chapter: this.data.level});
this.hidePanel();
}
initEvents() {
super.initEvents();
this.startBtn.addEventListener(MouseEvent.CLICK, this.startGame, this);
this.startBtn2.addEventListener(MouseEvent.CLICK, this.startGame, this);
}
removeEvents() {
super.removeEvents();
this.startBtn.removeEventListener(MouseEvent.CLICK, this.startGame, this);
this.startBtn2.removeEventListener(MouseEvent.CLICK, this.startGame, this);
}
}
This diff is collapsed.
...@@ -13,6 +13,7 @@ import Tween = FYGE.Tween; ...@@ -13,6 +13,7 @@ import Tween = FYGE.Tween;
import { Panel } from "../../../module/views/Panel"; import { Panel } from "../../../module/views/Panel";
import { showPanel } from "../../../module/ctrls"; import { showPanel } from "../../../module/ctrls";
import { StartPanel } from "../../panels/StartPanel"; import { StartPanel } from "../../panels/StartPanel";
import { StartPanelPrize } from "../../panels/StartPanelPrize";
export enum CHECK_TYPE { export enum CHECK_TYPE {
COM, // 普通 COM, // 普通
...@@ -21,6 +22,22 @@ export enum CHECK_TYPE { ...@@ -21,6 +22,22 @@ export enum CHECK_TYPE {
export default class CheckBtn extends Container { export default class CheckBtn extends Container {
private checkData: {
level: number,
scores: number,
stars: number,
isPrizeLevel: boolean,
isVisitSuccess: boolean
isPlayed: boolean
} = {
level: 1,
scores: 0,
stars: 0,
isPrizeLevel: false,
isVisitSuccess: false,
isPlayed: false
};
private btn: Button = null; private btn: Button = null;
private checkLabel: TextField = null; private checkLabel: TextField = null;
...@@ -35,9 +52,13 @@ export default class CheckBtn extends Container { ...@@ -35,9 +52,13 @@ export default class CheckBtn extends Container {
private _data: any = null; private _data: any = null;
public set data(data) { public set data(data) {
this._data = data; this._data = data;
if (!data) return;
if (!data.isVisitSuccess) return; if (!data.isVisitSuccess) return;
this.enabled = data.isVisitSuccess; this.enabled = data.isVisitSuccess;
this.starCount = data.stars; this.starCount = data.stars;
this.checkData = data;
this.checkData.isPlayed = true;
} }
private _starCount = 0; private _starCount = 0;
...@@ -154,6 +175,7 @@ export default class CheckBtn extends Container { ...@@ -154,6 +175,7 @@ export default class CheckBtn extends Container {
// 关卡文字 // 关卡文字
this.checkNum = data.check; this.checkNum = data.check;
this.checkData.level = data.check;
this.checkLabel = this.btn.addChild(Tools.getText( this.checkLabel = this.btn.addChild(Tools.getText(
data.check, 30, '#ffffff', data.check, 30, '#ffffff',
TEXT_ALIGN.CENTER, 90, 8, 33 TEXT_ALIGN.CENTER, 90, 8, 33
...@@ -169,7 +191,10 @@ export default class CheckBtn extends Container { ...@@ -169,7 +191,10 @@ export default class CheckBtn extends Container {
// 点击事件 // 点击事件
this.btn.addEventListener(MouseEvent.CLICK, () => { this.btn.addEventListener(MouseEvent.CLICK, () => {
console.log(`关卡:${this.checkNum}`); console.log(`关卡:${this.checkNum}`);
showPanel(StartPanel, {check: this.checkNum}); console.log(this.checkData);
this._isPrize
? showPanel(StartPanelPrize, this.checkData)
: showPanel(StartPanel, this.checkData);
}, this); }, this);
} }
...@@ -231,15 +256,16 @@ class CheckCurEffect extends Container { ...@@ -231,15 +256,16 @@ class CheckCurEffect extends Container {
.wait(700); .wait(700);
Tween.get(this.light1, {loop: true}) Tween.get(this.light1, {loop: true})
.set({alpha: 0}) .set({alpha: 1})
.to({alpha: 1}, 700) .wait(700)
// .to({alpha: 1}, 700)
.to({alpha: 0}, 600) .to({alpha: 0}, 600)
.wait(700) .wait(700)
Tween.get(this.light2, {loop: true}) Tween.get(this.light2, {loop: true})
.set({scaleX: 0.8, scaleY: 0.8}) .set({scaleX: 0.8, scaleY: 0.8})
.to({scaleX: 1.3, scaleY: 1.3}, 1000) .to({scaleX: 1.3, scaleY: 1.3}, 1000)
.wait(700); .wait(1000);
Tween.get(this.light2, {loop: true}) Tween.get(this.light2, {loop: true})
.set({alpha: 0}) .set({alpha: 0})
......
import MapPart from "./MapPart"; import MapPart from "./MapPart";
import { RES } from "../../../module/RES"; import { RES } from "../../../module/RES";
import Point = FYGE.Point; import Point = FYGE.Point;
import Sprite = FYGE.Sprite;
import { Tools } from "../../Tools";
import Tween = FYGE.Tween;
import Texture = FYGE.Texture;
import FrameAni = FYGE.FrameAni;
import { loadConfigurationFromPath } from "tslint/lib/configuration";
export default class MapMid extends MapPart { export default class MapMid extends MapPart {
...@@ -8,6 +14,12 @@ export default class MapMid extends MapPart { ...@@ -8,6 +14,12 @@ export default class MapMid extends MapPart {
protected totalCount = 10; protected totalCount = 10;
private balloon: Sprite = null;
private water: Sprite = null;
private water1: Texture = null;
private water2: Texture = null;
private whaleAni: FrameAni = null;
protected btnPos = [ protected btnPos = [
[267, 1519], [267, 1519],
[211, 1325], [211, 1325],
...@@ -27,8 +39,37 @@ export default class MapMid extends MapPart { ...@@ -27,8 +39,37 @@ export default class MapMid extends MapPart {
this.bg.texture = RES.getRes('map_bg2.jpg'); this.bg.texture = RES.getRes('map_bg2.jpg');
this.initIcon(); this.initIcon();
this.initEffect();
this.water1 = RES.getRes('water1.png');
this.water2 = RES.getRes('water2.png');
this.water = this.addChild(new Sprite(this.water1));
this.water.position.set(544, 687);
} }
private initEffect() {
this.balloon = this.addChild(Tools.getSprite('map_狐狸气球.png', -216, 750));
Tween.get(this.balloon, {loop: true})
.set({x: -216, y: 1150})
.to({x: 750 + 100, y: 837}, 20006);
this.water = this.addChild(new Sprite(this.water1));
this.water.position.set(544, 687);
const whaleTextures: Texture[] = new Array(25);
for (let i = 0; i < 13; i++) {
whaleTextures[25 - i] = whaleTextures[i] = RES.getRes(`map_whale_${i}.png`);
}
this.whaleAni = this.addChild(new FrameAni(whaleTextures));
this.whaleAni.position.set(645, 575);
this.whaleAni.play(-1);
}
private waterIndex1: boolean = true;
private waterIndex: number = 0;
public update() { public update() {
super.update(); super.update();
let up = this.localToGlobal(new Point(0, -10), new Point()); let up = this.localToGlobal(new Point(0, -10), new Point());
...@@ -39,6 +80,13 @@ export default class MapMid extends MapPart { ...@@ -39,6 +80,13 @@ export default class MapMid extends MapPart {
|| this.stage.viewRect.isPointIn(bp) || this.stage.viewRect.isPointIn(bp)
|| this.stage.viewRect.isPointIn(ucp) || this.stage.viewRect.isPointIn(ucp)
|| this.stage.viewRect.isPointIn(bcp); || this.stage.viewRect.isPointIn(bcp);
if (this.waterIndex++ > 5) {
this.waterIndex1 = !this.waterIndex1;
this.water.texture = this.waterIndex1 ? this.water1 : this.water2;
this.waterIndex = 0;
}
} }
......
...@@ -20,7 +20,7 @@ export class MapScene extends Scene { ...@@ -20,7 +20,7 @@ export class MapScene extends Scene {
MapScene.checkArr = []; MapScene.checkArr = [];
} }
private uiLayer: Container = null; private uiLayer: MapUI = null;
public get groupNames(): string[] { public get groupNames(): string[] {
return ['map']; return ['map'];
...@@ -49,6 +49,8 @@ export class MapScene extends Scene { ...@@ -49,6 +49,8 @@ export class MapScene extends Scene {
if (!success) return; if (!success) return;
this.uiLayer.energyBox.count = res.data.power;
const currentLevel = res.data.currentLevel; const currentLevel = res.data.currentLevel;
// 已经通关的 // 已经通关的
...@@ -58,8 +60,10 @@ export class MapScene extends Scene { ...@@ -58,8 +60,10 @@ export class MapScene extends Scene {
} }
// 当前关卡 // 当前关卡
MapScene.checkArr[currentLevel].type = CHECK_TYPE.CUR; if (currentLevel < 121) {
MapScene.checkArr[currentLevel].enabled = true; MapScene.checkArr[currentLevel].type = CHECK_TYPE.CUR;
MapScene.checkArr[currentLevel].enabled = true;
}
// 未通关的 // 未通关的
for (let i = currentLevel + 1; i < 121; i++) { for (let i = currentLevel + 1; i < 121; i++) {
......
...@@ -8,12 +8,13 @@ import { Tools } from "../../Tools"; ...@@ -8,12 +8,13 @@ import { Tools } from "../../Tools";
import MouseEvent = FYGE.MouseEvent; import MouseEvent = FYGE.MouseEvent;
export default class MapUI extends Container { export default class MapUI extends Container {
public energyBox: EnergyBox = null;
private creditsBox: CreditsBox = null;
private prizeBox: PrizeBox = null;
private myPrizeBtn: Button = null; private myPrizeBtn: Button = null;
private ruleBtn: Button = null; private ruleBtn: Button = null;
private taskBtn: Button = null; private taskBtn: Button = null;
private energyBox: EnergyBox = null;
private creditsBox: CreditsBox = null;
private prizeBox: PrizeBox = null;
constructor() { constructor() {
super(); super();
......
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