Commit fbb7cb17 authored by Tt's avatar Tt

修复代码异常

parent 7078c149
This diff is collapsed.
...@@ -101,10 +101,12 @@ export default class NewClass extends MyCocosSceneComponent { ...@@ -101,10 +101,12 @@ export default class NewClass extends MyCocosSceneComponent {
}) })
} }
onTouchMusicOn() { onTouchMusicOn() {
pg.view.visible(pg.view.find(this, 'btn_music/on'), false);
pg.view.visible(pg.view.find(this, 'btn_music/off'), true); pg.view.visible(pg.view.find(this, 'btn_music/off'), true);
pg.audio.pauseBgm(); pg.audio.pauseBgm();
} }
onTouchMusicOff() { onTouchMusicOff() {
pg.view.visible(pg.view.find(this, 'btn_music/on'), true);
pg.view.visible(pg.view.find(this, 'btn_music/off'), false); pg.view.visible(pg.view.find(this, 'btn_music/off'), false);
pg.audio.resumeBgm(); pg.audio.resumeBgm();
} }
...@@ -218,14 +220,14 @@ export default class NewClass extends MyCocosSceneComponent { ...@@ -218,14 +220,14 @@ export default class NewClass extends MyCocosSceneComponent {
if (this.turnRobot) { if (this.turnRobot) {
let points = this.getMovePoints(this.robotPoint, runNum); let points = this.getMovePoints(this.robotPoint, runNum);
console.log(points); console.log(points);
this.chessRobot.getComponent("chess").run(points).then(() => { this.chessRobot.getComponent("chess_ns20_jsqj").run(points).then(() => {
this.robotPoint += (points.length - 1); this.robotPoint += (points.length - 1);
resolve(''); resolve('');
}) })
} else { } else {
let points = this.getMovePoints(this.playerPoint, runNum); let points = this.getMovePoints(this.playerPoint, runNum);
console.log(points); console.log(points);
this.chessPlayer.getComponent("chess").run(points).then(() => { this.chessPlayer.getComponent("chess_ns20_jsqj").run(points).then(() => {
this.playerPoint += (points.length - 1); this.playerPoint += (points.length - 1);
resolve(''); resolve('');
}) })
...@@ -237,12 +239,12 @@ export default class NewClass extends MyCocosSceneComponent { ...@@ -237,12 +239,12 @@ export default class NewClass extends MyCocosSceneComponent {
let jumpCell = Game.getIns().getMap()[jumpId - 1]; let jumpCell = Game.getIns().getMap()[jumpId - 1];
let points = [cell, jumpCell]; let points = [cell, jumpCell];
if (this.turnRobot) { if (this.turnRobot) {
this.chessRobot.getComponent("chess").run(points).then(() => { this.chessRobot.getComponent("chess_ns20_jsqj").run(points).then(() => {
this.robotPoint = Number(jumpCell.id) - 1; this.robotPoint = Number(jumpCell.id) - 1;
resolve(''); resolve('');
}) })
} else { } else {
this.chessPlayer.getComponent("chess").run(points).then(() => { this.chessPlayer.getComponent("chess_ns20_jsqj").run(points).then(() => {
this.playerPoint = Number(jumpCell.id) - 1; this.playerPoint = Number(jumpCell.id) - 1;
resolve(''); resolve('');
}) })
...@@ -328,7 +330,7 @@ export default class NewClass extends MyCocosSceneComponent { ...@@ -328,7 +330,7 @@ export default class NewClass extends MyCocosSceneComponent {
pg.audio.stopAudio(this.touziAudio); pg.audio.stopAudio(this.touziAudio);
let touzi_ani = pg.view.find(this, "touzi_ani"); let touzi_ani = pg.view.find(this, "touzi_ani");
let icon = pg.view.find(touzi_ani, "icon"); let icon = pg.view.find(touzi_ani, "icon");
let touzi = icon.getComponent("touzi"); let touzi = icon.getComponent("touzi_ns20_jsqj");
let hand = pg.view.find(touzi_ani, "hand"); let hand = pg.view.find(touzi_ani, "hand");
let btn_stop = pg.view.find(touzi_ani, "btn_stop"); let btn_stop = pg.view.find(touzi_ani, "btn_stop");
pg.view.visible(btn_stop, false); pg.view.visible(btn_stop, false);
...@@ -356,7 +358,7 @@ export default class NewClass extends MyCocosSceneComponent { ...@@ -356,7 +358,7 @@ export default class NewClass extends MyCocosSceneComponent {
this.log("test startTouzi") this.log("test startTouzi")
let touzi_ani = pg.view.find(this, "touzi_ani"); let touzi_ani = pg.view.find(this, "touzi_ani");
let icon = pg.view.find(touzi_ani, "icon"); let icon = pg.view.find(touzi_ani, "icon");
let touzi = icon.getComponent("touzi"); let touzi = icon.getComponent("touzi_ns20_jsqj");
let hand = pg.view.find(touzi_ani, "hand"); let hand = pg.view.find(touzi_ani, "hand");
let btn_stop = pg.view.find(touzi_ani, "btn_stop"); let btn_stop = pg.view.find(touzi_ani, "btn_stop");
pg.view.visible(touzi_ani, true); pg.view.visible(touzi_ani, true);
...@@ -388,7 +390,7 @@ export default class NewClass extends MyCocosSceneComponent { ...@@ -388,7 +390,7 @@ export default class NewClass extends MyCocosSceneComponent {
} }
this.log("player: " + JSON.stringify({ player, robot })); this.log("player: " + JSON.stringify({ player, robot }));
onHomeworkFinish({ player, robot }) onHomeworkFinish({ player, robot })
// let state = pg.view.find(this, "state"); // let state = pg.view.find(this, "state");
// let bg_win = pg.view.find(state, "bg_win"); // let bg_win = pg.view.find(state, "bg_win");
......
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