Real-time, Multiplayer MSN-Minesweeper game using socket.io, jQuery and HTML5 canvas.
(Forked from https://github.com/Joeynoh/HTML5-Minesweeper)
Open this link and share the other link with your friend to start.
Aim: To discover (click on) more mines than your opponent. This is the opposite of the traditional minesweeper.
- You and your opponents take turns clicking on a tile that is not opened.
- If it is a mine, you get a point and one more try.
- If it is not a mine,
- It will show how many mines it is touching (1-8)
- If no mine is touching this tile, it will automatically open all touching tiles, causing a chain reaction
- The game ends when a player finds more than 50% mines
$ git clone https://github.com/vicksonzero/socketio-Minesweeper.git
$ npm install
$ npm start
GET /starts a new game, join it and show a link for the other playerGET /?token=TOKENjoins a game with a token.GET /newRoomstarts a new game, returns JSONGET /roomslists all games
src/app.js is in fact an express.Router. It means that you can do the following:
var express = require('express');
var app = express();
var msnSweeper = require('src/app');
app.use('/msnSweeper/', msnSweeper);
and serve msnSweeper inside another express module.
Game rooms are open by going to GET /, and is maintained as long as 1 of the players are still in the room.
Unfortunately, once both players leave the room, it is immediately destroyed.
I have no idea why, but you need to fill in actual ip address for socket.io stuff to work on DigitalOcean.
- Use bootstrap
- clean up commented unused code
- use view engines to inject data
use colored flags to distinguish mines flagged by different players- 5x5 bombs (well.....)
- mobile-friendly
Please open issues and/or pull requests. I am more than happy to follow-up.
The MIT License (MIT)
Copyright (c) 2016 Chui Hin Wah
