Skip to content

Navid079/minesweeper.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minesweeper.js

GitHub GitHub release (latest SemVer) GitHub file size in bytes on a specified ref (branch/commit/tag) GitHub file size in bytes on a specified ref (branch/commit/tag)

A simple Minesweeper game for web browsers.

Demo

Play Minesweeper using Minesweeper.js right now without any programming knowledge! Just click here to start playing.

Installation

  1. Add the following code to your HTML file:

    <script src="https://cdn.jsdelivr.net/gh/Navid079/minesweeper.js/index.js"></script>
    <!-- or minified version (About 2.9 KB) -->
    <!-- <script src="https://cdn.jsdelivr.net/gh/Navid079/minesweeper.js/index.min.js"></script> -->

Create a <canvas> element with id="navid079:minesweeper". Configure and start the game:

const config = {
  width: 10, // Number of tile columns
  height: 10, // Number of tile rows
  w_size: 70, // Tile width
  h_size: 70, // Tile height
  nMines: 10, // Number of mines
  color: {
    // Tile colors
    unknown: '#1a1a1a', // Not selected yet
    opened: 'white',
    mine: 'red',
    flagged: 'purple',
    border: '#a1a1a1',
    label: 'black',
  },
};

minesweeper.start(config);

And you're ready to go!

Versions

  • 1.0.0: Initial release

Future Updates

  • Add a timer
  • Implement game signals (reset, etc.)
  • Add sprite support

Contact and Contribution

Please send your comments, suggestions, and bug reports to my e-mail with the subject minesweeper.js-<title>. Feel free to fork, commit, and send pull requests.

Let's make Minesweeper.js better together!

About

This is a simple minesweeper game for web. You can simply customize and configure it and add it to your project.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors