labyrinth-game-logic
v1.0.51
Published
A libary that implements the boardgame labyrinth and exposes the functionality to create and interact with games
Downloads
119
Readme
labyrint-game-logic
example
const playerRed = new Player((readonlyGameState) => Promise); const playerGreen = new Player((readonlyGameState) => Promise); const playerYellow = new Player((readonlyGameState) => Promise);
const randomBoard = Game.generateRandomBoard();
const game = new Game({ playerGreen, playerRed, playerYellow, board: randomBoard });
game.addEventListener('gameended', (winner) => {}) game.addEventListener('playermoved', (move) => {}) game.addEventListener('treasurefound', (player, treasure) => {})
game.start()