snollygolly / open-hearts Goto Github PK
View Code? Open in Web Editor NEW:heart: An open source version of the card game Hearts.
:heart: An open source version of the card game Hearts.
Add a NoSQL database and tie it into the CONTROLLER. Avoid having the models call the DB directly if we don't have to.
The server needs to listen for connections and then store users that are connected in Redis.
When creating a new game, the user should see a confirmation message with a link to the game if creation was successful (going to /game?id=ID
).
If when creating a new game there was an error (the result object passed back from the server has an error property set to true), display and error explaining what went wrong (result.message should have error descriptions in it)
Actions encompass all the actions a player can perform. Note: examples don't include non-action related fields, such as token
pass
typeClient -> Server
{
"type": "pass",
"cards": [
"2H", "3H", "QS"
],
"to": "PLAYER ID RECEIVING CARDS"
}
play
typeClient -> Server
{
"type": "play",
"card": "5C"
}
We need to listen for the following.
pass
typeServer -> Client
{
"type": "pass",
"cards": [
"2H", "3H", "QS"
],
"from": "PLAYER ID SENDING CARDS"
}
play
typeServer -> Client
{
"from": "PLAYER ID WHO LAID THIS CARD DOWN",
"type": "play",
"card": "5C"
}
trick
typeServer -> Client
{
"type": "trick",
"cards": [
"2H", "3H", "QS", "5H"
],
"to": "PLAYER TAKING CARDS"
}
All action events happen with the emitter/broadcast action
As we're developing the socket.io parts, we need a way to test specific actions in the game without using the socket.io tester (which sucks) or waiting on the front end logic (which may take a while, or be optimized for playing the game vs. testing it).
We need to create a page with some simple client side JS that will perform common game actions and show us responses/results.
The goal with the dummy client is information gathering, and making testing quick.
To speed up our Travis CI build time, I'd like to migrate away from using NPM for front end modules, and instead have bower manage them.
In the package.json, the build
and watch
scripts have global commands attached to them. They need to be changed to the local versions so they work without global installs.
(Look at how we call tests to an example of this)
The README needs to have everything required to get up and running. The current build instructions aren't noted in there. They need to be.
Phases of play:
After the user inputs the number of players and creates the game on /
, we give them a game link
Formatted like: /game/:id
When that URL is accessed, on the backend, we make sure that a game with that ID exists. If it doesn't, we redirect to an error page and no action is needed from the client.
If the game is valid, we render the /game
view, and client side logic starts.
In addition to the kickoff events, some listeners need to be set
As of 14 Feb 2017, running npm install
on a fresh clone of this repo gives three deprecation warnings:
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: to-iso-string has been deprecated, use @segment/to-iso-string instead.
npm WARN deprecated [email protected]: Jade has been renamed to pug, please install the latest version of pug instead of jade
There are other outdated dependencies (npm outdated
lists browserify
13.3.0/14.0.0, radium
0.17.2/0.18.1, and shipit-cli
1.5.2/2.0.0); my expectation/hope is that a relative newbie to Node and to this project should find updating those and ensuring that none of the existing tests break ought to be a fairly gentle, low-risk ramping-up exercise.
minimatch
The minimatch
package is used by several direct and indirect dependencies; nearly all match against the current version (presently 3.0.3). [email protected]
is, however, a dependency of [email protected]
(current version: 7.1.1), itself a dependency of [email protected]
. An optimist might conjecture that updating koa-hbs
to the current 0.9.0 should fix that, considering that that package's current package.json
specifies a version of glob
matching "^7.0.5"
.
to-iso-string
The (original, deprecated) to-iso-string
is listed as a dependency in the package.json
for Mocha 2.5.3; it is not so listed in the current Mocha 3.2.0 package.json
. That's apparently because a newer version of @segment/to-iso-string
has been copied into the lib
directory since version 3.0.0-2
; technically, since Commit mochajs/mocha@37fa564. That suggests to our optimist that updating our dev dependency on Mocha from "^2.5.3"
to "^3.2.0"
should solve the issue, providing no other changes to Mocha break the current tests.
jade
/pug
According to the README for pug
, jade
was renamed to avoid colliding with a registered trademark. Inspection of the README history suggests that this dates from around March, 2016. Again, updating Mocha should remove the deprecation warning, since Mocha replaced jade
with pug
effective with Commit f50ad28, which was rolled into release 3.0.0-0 (Beta).
Models should be singular, so it needs to be renamed along with its tests, and all associated references.
Ping @snollygolly before merging PR.
We need an error view set up that we can render when something goes wrong.
For an example of what this might look like:
https://github.com/snollygolly/paw-wars/blob/master/views/error.hbs
We need to run ESlint on the code in addition to npm test
to ensure that proper styling is followed.
./node_modules/.bin/mocha ./tests/ && ./node_modules/.bin/eslint .
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.