Giter Site home page Giter Site logo

master-of-the-flag's Introduction

Master of the Flag

Play Master of the Flag online with friends in real time; no logins needed. Uses cookies to remember players, Express for route handling, React for UI, and Socket.IO for client-server communcation. Deployment planned for future.

demo

Installation

This game isn't ready for internet deployment yet, so you'll have to play it locally.

  1. Clone the repo (feel free to use shallow cloning to save time): git clone --depth 1 https://github.com/galenlong/master-of-the-flag.git.
  2. Download node.js (must be at least version 4).
  3. From inside the root directory of the project folder, run the command npm install. This will install all package dependencies.
  4. From the same root directory, run the command npm run build. This will compile and combine all Javascript files.
  5. From the same root directory, run npm run start. This will start the server.
  6. Direct a browser to the localhost address http://127.0.0.1:8080/master-of-the-flag. Click "Create a new game". Visit the generated link, and also send the link to a different browser (because the game uses cookies to identify players, we need to play with two different browsers, even locally). Now the two browsers will be able to play Stratego with each other.

TODO

UI/front end

  • Draw crown on favicon
  • Set flag font color to gold
  • Box shadow around capture messsage pieces so easier to see
  • Remove tableify from message display, simplify CSS
  • Change raw center tag in game view to CSS
  • Fix height of message div without overflow to prevent resizing
  • Fade background color on new message
  • Style buttons
  • Grey out player's pieces when not player's turn

Game creation

  • Show list of games in cookies along with relative dates (Just now, 2 days ago, etc.)
  • Allow game deletion
  • Add message if unable to write to cookies

Setup

  • Allow clicking/dragging to swap pieces
  • Allow loading positions from text file
  • Add button to flip positions vertically in case file loaded backwards
  • Change random starting arrangement to randomly tweaked good starting setups

Gameplay

  • Add surrender button
  • Add box showing remaining ranks for each player
  • Add rules selection at game start

Server

  • Database to store game information
  • Memory profiling to ensure we don't exceed server space
  • Consider replacing socket.io with WebSockets
  • Move socket handling, HTML response, and Express middleware into separate modules

Stability

  • Memory profiling for games created
  • Cron job to check if website up
  • Performance profiling
  • Better error page
  • Game removal once finished or if never used

Code

  • Add flags for easier testing
  • Add enums for CSS style classes
  • Add enums for socket.io event names
  • Move tests.js to testing folder
  • Move styling from dist/ folder to resources/ on root
  • Switch from ES6 classes to React.createClasses

master-of-the-flag's People

Contributors

galenlong avatar

Watchers

James Cloos avatar

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.