darts-scorer-core
v1.3.0
Published
Darts Scorer helps to manage multi-player games. It is written in the way that is framework agnostic.
Downloads
18
Maintainers
Readme
darts-scorer-core
This is a core module for building Darts games and front-end.
It is easy to extend to match own needs.
Installation
npm install darts-scorer-core --save-dev
Example Usage
import dartsScorerCore from 'darts-scorer-core';
let player1 = new dartsScorerCore.Player('Player 1');
let player2 = new dartsScorerCore.Player('Player 2');
let game = new dartsScorerCore.games.Darts501Game([player1, player2]);
game.throw(10);
game.throw(15, 2);
game.throw(20, 3);
console.log('Player 1 points', game.currentPlayerTotalPoints);
game.nextPlayer();
game.throw(1);
game.throw(18, 2);
game.throw(19, 3);
console.log('Player 2 points', game.currentPlayerTotalPoints);
game.nextRound();
Contributing
Follow the airbnb styleguide.
Requires node ^5.0.0
.
npm install
License
MIT