Commit e40adfcb authored by 范雪寒's avatar 范雪寒

feat: 语法报错

parent 4262736a
...@@ -141,8 +141,8 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -141,8 +141,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
.start(); .start();
}); });
const dice = cc.find("Canvas/bg/chessBoard/diceBg/dice"); const dice2 = cc.find("Canvas/bg/chessBoard/diceBg/dice");
dice["canClick"] = true; dice2["canClick"] = true;
} }
stopBlinkTheDice() { stopBlinkTheDice() {
...@@ -153,8 +153,8 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -153,8 +153,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
node.scale = 1; node.scale = 1;
node.opacity = 255; node.opacity = 255;
}); });
const dice = cc.find("Canvas/bg/chessBoard/diceBg/dice"); const dice2 = cc.find("Canvas/bg/chessBoard/diceBg/dice");
dice["canClick"] = false; dice2["canClick"] = false;
} }
greyDice() { greyDice() {
...@@ -602,7 +602,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -602,7 +602,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
.delay(0.5) .delay(0.5)
.to(0.5, { opacity: 0 }) .to(0.5, { opacity: 0 })
.call(() => { .call(() => {
resolve(); resolve(null);
}) })
.start(); .start();
}); });
......
...@@ -224,7 +224,7 @@ export default class SceneComponent extends cc.Component { ...@@ -224,7 +224,7 @@ export default class SceneComponent extends cc.Component {
return; return;
} }
this.stopCurrentPlayedAudio(); this.stopCurrentPlayedAudio();
cc.assetManager.loadRemote(audio_url.toLowerCase(), (err, audioClip) => { cc.assetManager.loadRemote(audio_url.toLowerCase(), (err, audioClip: cc.AudioClip) => {
const audioId = cc.audioEngine.play(audioClip, false, 0.8); const audioId = cc.audioEngine.play(audioClip, false, 0.8);
this.currentPlayedAudioId = audioId; this.currentPlayedAudioId = audioId;
if (cb) { if (cb) {
......
...@@ -123,11 +123,11 @@ export class MyCocosSceneComponent extends cc.Component { ...@@ -123,11 +123,11 @@ export class MyCocosSceneComponent extends cc.Component {
}); });
} }
log (str) { log(str) {
const node = cc.find('middleLayer'); const node = cc.find('middleLayer');
if(node){ if (node) {
node.getComponent('middleLayer').log(str); node.getComponent('middleLayer').log(str);
}else{ } else {
cc.log(str); cc.log(str);
} }
} }
...@@ -182,7 +182,7 @@ export class MyCocosSceneComponent extends cc.Component { ...@@ -182,7 +182,7 @@ export class MyCocosSceneComponent extends cc.Component {
playAudioByUrl(audio_url, cb = null) { playAudioByUrl(audio_url, cb = null) {
if (audio_url) { if (audio_url) {
cc.assetManager.loadRemote(audio_url, (err, audioClip) => { cc.assetManager.loadRemote(audio_url, (err, audioClip: cc.AudioClip) => {
const audioId = cc.audioEngine.play(audioClip, false, 0.8); const audioId = cc.audioEngine.play(audioClip, false, 0.8);
if (cb) { if (cb) {
cc.audioEngine.setFinishCallback(audioId, () => { cc.audioEngine.setFinishCallback(audioId, () => {
......
import { Base64 } from "js-base64";
export class NetworkHelper { export class NetworkHelper {
_eventListeners: any = {}; _eventListeners: any = {};
ctor() {} ctor() {}
...@@ -127,7 +125,7 @@ export class NetworkHelper { ...@@ -127,7 +125,7 @@ export class NetworkHelper {
console.log("this.room = " + JSON.stringify(this.room.roomInfo)); console.log("this.room = " + JSON.stringify(this.room.roomInfo));
} }
player: MGOBE.Player; player: any;
joinRoom(roomType: string, maxPlayers: number, customData: string = "") { joinRoom(roomType: string, maxPlayers: number, customData: string = "") {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const playerName = "Tom" + Math.random(); const playerName = "Tom" + Math.random();
...@@ -366,7 +364,7 @@ export function asyncDelay(time) { ...@@ -366,7 +364,7 @@ export function asyncDelay(time) {
cc.tween(cc.find("Canvas")) cc.tween(cc.find("Canvas"))
.delay(time) .delay(time)
.call(() => { .call(() => {
resolve(); resolve(null);
}) })
.start(); .start();
}); });
......
...@@ -107,7 +107,7 @@ export class GameServer { ...@@ -107,7 +107,7 @@ export class GameServer {
} }
async onFrameEvent(data) { async onFrameEvent(data) {
if (this.gameStatus.gameOver) { if (this.gameStatus['gameOver']) {
return; return;
} }
if (data.type == "roll") { if (data.type == "roll") {
...@@ -128,7 +128,7 @@ export class GameServer { ...@@ -128,7 +128,7 @@ export class GameServer {
type: "SERVER_playerWin", type: "SERVER_playerWin",
color: this.gameStatus.current, color: this.gameStatus.current,
}); });
this.gameStatus.gameOver = true; this.gameStatus['gameOver'] = true;
} }
} else if (data.type == "right") { } else if (data.type == "right") {
if (this.gameStatus.letter != "") { if (this.gameStatus.letter != "") {
...@@ -149,7 +149,7 @@ export class GameServer { ...@@ -149,7 +149,7 @@ export class GameServer {
type: "SERVER_playerWin", type: "SERVER_playerWin",
color: this.gameStatus.current, color: this.gameStatus.current,
}); });
this.gameStatus.gameOver = true; this.gameStatus['gameOver'] = true;
} }
} else { } else {
console.log('汪汪汪'); console.log('汪汪汪');
......
...@@ -102,7 +102,7 @@ export function getDistance(start, end) { ...@@ -102,7 +102,7 @@ export function getDistance(start, end) {
export function playAudioByUrl(audio_url, cb = null) { export function playAudioByUrl(audio_url, cb = null) {
if (audio_url) { if (audio_url) {
cc.assetManager.loadRemote(audio_url, (err, audioClip) => { cc.assetManager.loadRemote(audio_url, (err, audioClip: cc.AudioClip) => {
const audioId = cc.audioEngine.play(audioClip, false, 0.8); const audioId = cc.audioEngine.play(audioClip, false, 0.8);
if (cb) { if (cb) {
cc.audioEngine.setFinishCallback(audioId, () => { cc.audioEngine.setFinishCallback(audioId, () => {
......
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