Code Monkey home page Code Monkey logo

blackjackery's Introduction

Blackjackery

A simplified multiplayer blackjack webgame written in ES6 using AngularJS and Express.

Made as an exercise in rapid prototyping, WebSockets, and using the (M)EAN stack to create a functional MVP in hours.

Screenshot v0

Demo

Click here for a demo

(currently best played on desktop or tablet)

Installation and Use

This project was generated with the Angular Full-Stack Generator version 3.2.0.

Prerequisites

Developing

  1. Run npm install to install server dependencies.
  2. Run bower install to install front-end dependencies.
  3. Run grunt serve to start the development server. It should automatically open the client in your browser when ready.

Build & development

Run grunt build for building and grunt serve for preview.

Testing

Running npm test will run the unit tests with karma.

Features

  • 1 table
  • 1 dealer with 1 standard deck
  • up to 7 players
    • if the table is full, new players are put in a wait queue
  • a new game is started as soon as there is at least 1 player connected
  • losses and wins are counted (no betting)
  • players can either hit or stick (no splitting)

Wireframe

First wireframe

Game flow

Game flow

Player state

Player state

Implementation

I've opted to use a Yeoman generator to quickly scaffold a MEAN app: generator-angular-fullstack

Client-side is a simple Angular app and consists of just 1 view with a controller, a service for tracking the game state, and a service for the socket connections.

Server-side is an Express app. The game state is kept in memory with the Game module and is expressed using a simple model:

Class diagram

For every new client connected, there is a player.socket.js handler that deals with joining and other actions.

The dealer.socket.js handler checks the game state every X ms and changes the game & player states accordingly (see above).

Backlog

High prio

  • Timer for actions (otherwise players can join and block the game)
  • Customized dealer / end of game feedback per player
  • Show timers realtime
  • Show value of current hand
  • Show stats: player and dealer scores
  • Cards: responsive layout (not good in mobile)

Medium

  • Better UI (flash changes to model)
  • Card colors
  • Show people in wait queue

Low prio

  • Option to split cards
  • Betting
  • Multiple tables
  • Card animations
  • Store games and scores in a MongoDB database

blackjackery's People

Stargazers

 avatar  avatar

Watchers

 avatar

blackjackery's Issues

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.