mirror of
https://github.com/Aviortheking/Puissance4.git
synced 2025-04-22 10:52:15 +00:00
26 lines
489 B
TypeScript
26 lines
489 B
TypeScript
import './style.css'
|
|
|
|
import Game from './Game'
|
|
import { DOMElement } from '@dzeio/dom-manager'
|
|
|
|
const table = document.querySelector('table')
|
|
|
|
if (!table) {
|
|
throw new Error('Table not found')
|
|
}
|
|
|
|
const game = new Game(table)
|
|
const restartBtn = DOMElement.get('.restartBtn')
|
|
if (restartBtn) {
|
|
game.setRestartButton(restartBtn)
|
|
}
|
|
|
|
game.playerColor = 'yellow'
|
|
game.startSinglePlayer()
|
|
|
|
|
|
const ws = new WebSocket('ws://localhost:8080')
|
|
ws.onmessage = (event) => {
|
|
console.log(event.data)
|
|
}
|