PHP Classes

PHP Minesweeper: Manage the Minesweeper game on a Web pages

Recommend this page to a friend!

  Author Author  
Picture of Martijn Waeyenbergh
Name: Martijn Waeyenbergh <contact>
Classes: 3 packages by
Country: Belgium Belgium
Innovation award
Innovation award
Nominee: 1x


  Detailed description   Download Download .zip .tar.gz   Install with Composer Install with Composer  
This package can manage the Minesweeper game on Web pages.

It can display a board of squared blocks in a grid containing hidden bombs in positions randomly picked by the package. The grid size and the number of bombs placed on the grid are configurable settings.

The package can process the player's clicks on a block by telling if the user clicked on a bomb block or not.

If the block does not have a bomb, the package updates the partnership with the number of explosions that surround that block.

The package also displays a counter that shows how many moves you have already made.

Details

PHPmineSweeper

Minesweeper A grid is created from x on y, with bombs in it in random places. Around the bombs is indicated how many adjacent bombs there are to that square. This can be horizontal, vertical and diagonal. On boxes without adjacent bombs, there will be no value.

When clicked, it shows either:

an empty field, and all adjacent empty fields are also shown. a field with a number (the number of adjacent bombs) a bomb -> you are lost. To keep track, I create 2 arrays. The first to keep track of the field itself The second to keep track of which field has already been clicked on. You can then also check this each time.

There is also a counter that keeps track of how many moves you have already made.

Using the parameters below, you can determine the size of the game board and the number of bombs.

in the settings.php file, you can specify the size (how many grids) and the number of mines in the game.


  Classes of Martijn Waeyenbergh  >  PHP Minesweeper  >  Download Download .zip .tar.gz  >  Support forum Support forum  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: PHP Minesweeper
Base name: phpminesweeper
Description: Manage the Minesweeper game on a Web pages
Version: 1.0.0
PHP version: 5
License: Freeware
 
  Groups   Screenshots Screenshots   Applications   Files Files  

  Groups  
Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes
Group folder image Games Sports and online games View top rated classes

  Files folder image Screenshots  
lost.png
File Role Description
Accessible without login Image file lost.png Screen lost a game
Accessible without login Image file new.png Screen new game started
Accessible without login Image file play.png Screen playing a game


  Applications that use this package  
No pages of applications that use this class were specified.

Add link image If you know an application of this package, send a message to the author to add a link here.

  Files folder image Files  
File Role Description
Plain text file class.mineGame.php Class Class source
Accessible without login Plain text file game.php Example Example script
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file readme.md Doc. Documentation
Accessible without login Plain text file settings.php Conf. Auxiliary script

Install with Composer Install with Composer - Download Download all files: phpminesweeper.tar.gz phpminesweeper.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.
For more information send a message to info at phpclasses dot org.