https://github.com/b-goodman/minesweeper-game
Minesweeper game implemented with custom elements.
https://github.com/b-goodman/minesweeper-game
custom-elements game web-components
Last synced: about 2 months ago
JSON representation
Minesweeper game implemented with custom elements.
- Host: GitHub
- URL: https://github.com/b-goodman/minesweeper-game
- Owner: b-goodman
- Created: 2020-01-02T02:51:13.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T13:37:52.000Z (over 3 years ago)
- Last Synced: 2025-08-23T06:40:58.516Z (10 months ago)
- Topics: custom-elements, game, web-components
- Language: TypeScript
- Size: 501 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# minesweeper-game
The popular game 'minesweeper' made available as a custom element.
## Installation
```bash
yarn add @bgoodman/minesweeper-game
npm install @bgoodman/minesweeper-game
```
## Usage
```html
Minesweeper
```
## Attributes
### `width` (number)
The width (in cells) of the game grid.
### `height` (number)
The height (in cells) of the game grid.
### `mines` (number)
Override the default amount of mines placed in the game. Otherwise calculated as `Math.floor(Math.sqrt(height * width))`.
### `scale` (number)
Override the game's default scale in multiples of `1`. Values less(greater) than `1` will result in a smaller(larger) width and height of the game grid. Default scale (`1`) renders each cell in the game grid as `30px` x `30px`.
---
## Methods
### `newGame(): void`
Resets the current game using existing values of `width`, `height` and (optionally) `mines`.