Commit fbb7cb17 authored by Tt's avatar Tt

修复代码异常

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