Commit 0f87122a authored by unknown's avatar unknown

独一无二加入说明和可控分数

parent 817acd89
...@@ -7,6 +7,7 @@ import { viewMgr, VIEW_INDEX } from '../../../../startFolder/script/common/ViewM ...@@ -7,6 +7,7 @@ import { viewMgr, VIEW_INDEX } from '../../../../startFolder/script/common/ViewM
import { GameEndDataItf, htmlSendDataMgr } from '../../../../startFolder/script/HtmlSendDataMgr'; import { GameEndDataItf, htmlSendDataMgr } from '../../../../startFolder/script/HtmlSendDataMgr';
import { ClassifyUtils } from '../../classify/script/ClassifyUtils'; import { ClassifyUtils } from '../../classify/script/ClassifyUtils';
import { BeginCountdownView } from '../../commonView/script/BeginCountdownView'; import { BeginCountdownView } from '../../commonView/script/BeginCountdownView';
import { GameDescView } from '../../commonView/script/GameDescView';
import { ScoreFailView } from '../../commonView/script/ScoreFailView'; import { ScoreFailView } from '../../commonView/script/ScoreFailView';
import { ScoreSuccView } from '../../commonView/script/ScoreSuccView'; import { ScoreSuccView } from '../../commonView/script/ScoreSuccView';
import { ScoreWaitView } from '../../commonView/script/ScoreWaitView'; import { ScoreWaitView } from '../../commonView/script/ScoreWaitView';
...@@ -102,10 +103,35 @@ export class ClassifyCtr_1 extends Component { ...@@ -102,10 +103,35 @@ export class ClassifyCtr_1 extends Component {
private bestScore: number = 0; private bestScore: number = 0;
private isPlayCountdownMus = false; private isPlayCountdownMus = false;
private isShowDescOnce = false;
showGameDescView() {
viewMgr.openView(VIEW_DEF.GameDescView, (node) => {
node.getComponent(GameDescView)?.setDesc("如果左边出现与中间一样的图形\n则点击左边箭头\n反之点击右边箭头");
});
}
onCloseGameDescView() {
if (this.gameState == GameState.END) return;
if (!this.isShowDescOnce) {
this.isShowDescOnce = true;
this.beginTime = new Date().getTime();
this.gameState = GameState.RUN;
}
}
start() { start() {
let outGameTime = Utils.getValueFromHref("gameTime"); let outGameTime = Utils.getValueFromHref("gameTime");
if (outGameTime !== null) { if (outGameTime !== null) {
this.totalTime = <number><any>outGameTime; this.totalTime = Number(outGameTime);
}
let outOneScore = Utils.getValueFromHref("oneScore");
if (outOneScore !== null) {
this.oneScore = Number(outOneScore);
}
let outSsuccScore = Utils.getValueFromHref("succScore");
if (outSsuccScore !== null) {
this.succScore = Number(outSsuccScore);
} }
for (let i = 0; i < this.leftPosNodes.length; ++i) { for (let i = 0; i < this.leftPosNodes.length; ++i) {
let itemCom: ClassifyItem_1 = instantiate(this.itemPre).getComponent(ClassifyItem_1)!; let itemCom: ClassifyItem_1 = instantiate(this.itemPre).getComponent(ClassifyItem_1)!;
...@@ -130,10 +156,16 @@ export class ClassifyCtr_1 extends Component { ...@@ -130,10 +156,16 @@ export class ClassifyCtr_1 extends Component {
}); });
}); });
director.on("begin_countdown_end", () => { director.on("begin_countdown_end", () => {
this.beginTime = new Date().getTime(); if (!this.isShowDescOnce) {
this.gameState = GameState.RUN; this.showGameDescView();
}
else {
this.beginTime = new Date().getTime();
this.gameState = GameState.RUN;
}
find("Canvas")?.getComponent(ClassifyGuideCtr_1)?.init(); find("Canvas")?.getComponent(ClassifyGuideCtr_1)?.init();
}); });
director.on("close_desc_view", this.onCloseGameDescView, this);
} }
resetGame() { resetGame() {
this.isPlayCountdownMus = false; this.isPlayCountdownMus = false;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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