This commit is contained in:
Jose Conde
2024-07-07 23:27:14 +02:00
parent 9a6f430e4d
commit d999bb3479
15 changed files with 213 additions and 76 deletions

View File

@ -17,7 +17,7 @@ export class Game {
boardScale: 1,
handScale: 1,
width: 1200,
height: 650
height: 800
},
private emit: any,
private socketService: SocketIoClientService,
@ -27,7 +27,7 @@ export class Game {
async setup(): Promise<HTMLCanvasElement> {
const width = 1200
const height = 650
const height = 800
await this.app.init({ width, height })
return this.app.canvas
@ -77,7 +77,7 @@ export class Game {
this.hand.on('nextClick', async () => {
await this.socketService.sendMessageWithAck('playerReady', {
user: this.playerId,
userId: this.playerId,
sessionId: this.sessionId
})
})

View File

@ -48,12 +48,16 @@ export class Hand extends EventEmitter {
gameFinished() {
this.logger.debug('gameFinished')
this.tiles = []
this.container.removeChildren()
this.initialized = false
this.buttonNext = this.createButton(
'NEXT',
{ x: this.width / 2 - 25, y: this.height / 2, width: 50, height: 20 },
'nextClick'
() => {
this.container.removeChildren()
this.container.removeChild(this.buttonNext)
this.emit('nextClick')
}
)
}