Commit 176a5498 authored by 范雪寒's avatar 范雪寒

feat:

parent 6aea4023
...@@ -525,7 +525,10 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -525,7 +525,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
updateStatus(status = null) { updateStatus(status = null) {
if (status) { if (status) {
console.log(status);
this._status = JSON.parse(JSON.stringify(status)); this._status = JSON.parse(JSON.stringify(status));
} else {
console.log('喵喵喵');
} }
const playerMe = this.allPlayerList.find( const playerMe = this.allPlayerList.find(
(player) => player.uuid == this.playerId (player) => player.uuid == this.playerId
...@@ -577,8 +580,10 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -577,8 +580,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
changeSide() { changeSide() {
if (this._status.current == "Red") { if (this._status.current == "Red") {
this._status.current = "Blue"; this._status.current = "Blue";
console.log('changeSide Blue');
} else { } else {
this._status.current = "Red"; this._status.current = "Red";
console.log('changeSide Red');
} }
} }
......
...@@ -37,6 +37,7 @@ export class AI { ...@@ -37,6 +37,7 @@ export class AI {
if (this.playerData.color == this._status.current) { if (this.playerData.color == this._status.current) {
await asyncDelay(Math.random() * 3 + 4); await asyncDelay(Math.random() * 3 + 4);
if (this._status.letter == "") { if (this._status.letter == "") {
await asyncDelay(Math.random() * 3 + 2);
this.networkHelper.sendFrame({ this.networkHelper.sendFrame({
type: "roll", type: "roll",
uuid: this.playerData.uuid, uuid: this.playerData.uuid,
......
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