Giter VIP home page Giter VIP logo

node-parcheesi's Introduction

node-parcheesi

We're building a Parcheesi game using nodeJS, and Web Sockets.

The project is being built using TDD. Check out the failing tests and the issue section if you want to collaborate!

Getting Started

  1. Clone the repository or download the zip file into a new folder
  2. Perform npm install in order to install all package dependencies
  3. If you haven't installed mocha globally go ahead and also do npm install mocha -g. This is needed to make use of the mocha CLI

For more information:

node-parcheesi's People

Contributors

amhed avatar mamodom avatar mortonfox avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

gratereaux

node-parcheesi's Issues

Investigate if there's a setupFixture for mocha

Frameworks such as nUnit have a SetupFixture attribtue that defines a "previous method" that is called before each test.

This is useful for repetitive code. In our case we almost always have to do something like this:

var game = new parcheesi.ParcheesiGame();

Wouldn't it be nice to declare it just once?

Error management

How can we emit errors? I'm trying to create a method that will move pawns around the board. Something like this:

//this would move pawn no. 0 or player mo. 0, 4 spaces
game.movePawn(0,0,4);

But this would be subject to many preconditions before executing: it's the user's turn, the pawn is not on the home area, the pawn has available spaces to move, an enemy barricade isn't blocking the way, etc.

What's the best way to emit the errors?

Pawn even emitters?

Checkout the TODO on parcheesi.js, line 226 about using an event emitter for the movement of the pawns instead of doing it manually?

Just a posibility

How to handle spaces management

Right now the JSON that holds the game is the following:

{
    spaces: []
    stairs: [
        { color: 'red', spaces: [,,,,,,,,] },
        { color: 'yellow', spaces: [,,,,,,,,] },
        { color: 'green', spaces: [,,,,,,,,] },
        { color: 'blue', spaces: [,,,,,,,,] },
    ]
}

I'm writing up the function that moves the pawn from one space to the other. The first array called spaces has 68 positions that compose the whole board, while the inner arrays inside each stair object has 8 spaces for the stair.

Is this the best configuration possible?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.