refactor: misc
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import Phaser from 'phaser';
|
||||
import type { BoopState, PlayerType, PieceType } from '@/game/boop';
|
||||
import type { BoopState } from '@/game/boop';
|
||||
import { GameHostScene } from 'boardgame-phaser';
|
||||
import { commands } from '@/game/boop';
|
||||
import { BoardRenderer } from './BoardRenderer';
|
||||
@@ -36,7 +35,7 @@ export class GameScene extends GameHostScene<BoopState> {
|
||||
});
|
||||
|
||||
// 监听状态变化
|
||||
this.watch(() => {
|
||||
this.addEffect(() => {
|
||||
const winner = this.state.winner;
|
||||
if (winner) {
|
||||
this.winnerOverlay.show(winner);
|
||||
@@ -45,7 +44,7 @@ export class GameScene extends GameHostScene<BoopState> {
|
||||
}
|
||||
});
|
||||
|
||||
this.watch(() => {
|
||||
this.addEffect(() => {
|
||||
const currentPlayer = this.state.currentPlayer;
|
||||
this.boardRenderer.updateTurnText(currentPlayer, this.state);
|
||||
this.supplyUI.update(this.state);
|
||||
|
||||
Reference in New Issue
Block a user