Package detail

flash-duel

kennethklee10none0.0.2

Flash Duel board game

board, game, flash, duel

readme

flash-duel

Flash Duel board game library with basic game modes.

  • 1v1
  • 2v2

features

  • event based turns
  • extendable

usage

var Game = require('flash-duel').Game;

var game = new Game('1v1', function(err, game) {
    // game initialized
});

// or
game.on('init', function(err, game) {
    // game initialized
});

// Handle start event
game.on('start', function(err, game) {

    game.players[0].on('turn', function(action, game) {
        // Player can perform an action
    });

    game.players[0].on('defend', function(defend, game) {
        // Player can defend from an attack
    });

    game.players[0].on('recover', function(game) {
        // Player is informed when turn is skipped and is recovering
    });

    game.players[0].on('win', function(action, game) {
        // Player has won!
    });

    game.players[0].on('lost', function(action, game) {
        // Player has lost!
    });

});

// Trigger the start of a game
game.start();

entities

  • Game
  • Board
  • Deck
  • Player
  • Game Mode