Commit 47c8afcb authored by 范雪寒's avatar 范雪寒

feat:

parent b1ee5891
......@@ -354,6 +354,45 @@ export default class SceneComponent extends MyCocosSceneComponent {
});
}
});
node.on(cc.Node.EventType.TOUCH_CANCEL, async (event: cc.Event.EventTouch) => {
const playerMe = this.allPlayerList.find(
(player) => player.uuid == this.playerId
);
if (playerMe.color != this._status.current) {
return;
}
if (this._status.current != color) {
return;
}
if (this._status.letter == "") {
return;
}
if (node["cantMove"]) {
return;
}
node["cantMove"] = true;
if (this.checkNodeInRightBlock(node, color)) {
const idx = this.getNextRightIdx();
const playerMe = this.allPlayerList.find(
(player) => player.uuid == this.playerId
);
this.networkHelper.sendFrame({
type: "right",
idx: idx,
uuid: playerMe.uuid,
color: playerMe.color,
});
} else {
const playerMe = this.allPlayerList.find(
(player) => player.uuid == this.playerId
);
this.networkHelper.sendFrame({
type: "wrong",
uuid: playerMe.uuid,
color: playerMe.color,
});
}
});
}
blinkPiece(node) {
......
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