Commit cc1de00b authored by unknown's avatar unknown

独一无二的玩法说明也好了

parent e2e1e7b9
...@@ -9,6 +9,7 @@ import { ClassifyUtils } from '../../classify/script/ClassifyUtils'; ...@@ -9,6 +9,7 @@ import { ClassifyUtils } from '../../classify/script/ClassifyUtils';
import { BeginCountdownView } from '../../commonView/script/BeginCountdownView'; import { BeginCountdownView } from '../../commonView/script/BeginCountdownView';
import { ChallengeFailView } from '../../commonView/script/ChallengeFailView'; import { ChallengeFailView } from '../../commonView/script/ChallengeFailView';
import { ChallengeSuccView } from '../../commonView/script/ChallengeSuccView'; import { ChallengeSuccView } from '../../commonView/script/ChallengeSuccView';
import { GameDescView } from '../../commonView/script/GameDescView';
import { SwitchErrorView } from '../../commonView/script/SwitchErrorView'; import { SwitchErrorView } from '../../commonView/script/SwitchErrorView';
import { SwitchOkView } from '../../commonView/script/SwitchOkView'; import { SwitchOkView } from '../../commonView/script/SwitchOkView';
import { ClassifyGuideCtr_1 } from './ClassifyGuideCtr_1'; import { ClassifyGuideCtr_1 } from './ClassifyGuideCtr_1';
...@@ -101,6 +102,22 @@ export class ClassifyCtr_1 extends Component { ...@@ -101,6 +102,22 @@ export class ClassifyCtr_1 extends Component {
private bestScore: number = 0; private bestScore: number = 0;
private isPlayCountdownMus = false; private isPlayCountdownMus = false;
private isShowGameDescViewOnce = false;
showGameDescView() {
viewMgr.openView(VIEW_DEF.GameDescView, (node) => {
node.getComponent(GameDescView)?.setDesc("中间的图形如果出现在左边则点击左边箭头,\n出现在右边则点击右边箭头。");
});
}
onCloseGameDescView() {
if (!this.isShowGameDescViewOnce) {
this.beginTime = new Date().getTime();
this.gameState = GameState.RUN;
this.isShowGameDescViewOnce = true;
}
}
setGameData(resData: object) { setGameData(resData: object) {
//@ts-ignore //@ts-ignore
if (resData.totalTime) { if (resData.totalTime) {
...@@ -112,11 +129,19 @@ export class ClassifyCtr_1 extends Component { ...@@ -112,11 +129,19 @@ export class ClassifyCtr_1 extends Component {
//@ts-ignore //@ts-ignore
this.succScore = resData.succScore; this.succScore = resData.succScore;
} }
//@ts-ignore //@ts-ignore
if (resData.oneScore) { if (resData.oneScore) {
//@ts-ignore //@ts-ignore
this.oneScore = resData.oneScore; this.oneScore = resData.oneScore;
} }
//@ts-ignore
if (resData.isShowGuide) {
//@ts-ignore
this.isShowGameDescViewOnce = false;
}
else {
this.isShowGameDescViewOnce = true;
}
} }
start() { start() {
...@@ -142,16 +167,23 @@ export class ClassifyCtr_1 extends Component { ...@@ -142,16 +167,23 @@ export class ClassifyCtr_1 extends Component {
this.resetGame(); this.resetGame();
}); });
director.on("finish_game", () => { director.on("finish_game", () => {
}); });
director.on("begin_countdown_end", () => { director.on("begin_countdown_end", () => {
this.beginTime = new Date().getTime(); if (!this.isShowGameDescViewOnce) {
this.gameState = GameState.RUN; this.gameState = GameState.PAUSE;
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("game_desc_close", this.onCloseGameDescView, this);
} }
onDestroy(){ onDestroy() {
director.off("continue_game"); director.off("continue_game");
director.off("begin_countdown_end"); director.off("begin_countdown_end");
} }
...@@ -344,8 +376,8 @@ export class ClassifyCtr_1 extends Component { ...@@ -344,8 +376,8 @@ export class ClassifyCtr_1 extends Component {
} }
//新手引导相关 //新手引导相关
pauseGame() { pauseGame() {
this.gameState = GameState.PAUSE; this.gameState = GameState.PAUSE;
} }
......
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