You can see first it’s loading the engine, then the config, before it starts main.js. The first screen we’re presented with the base game setup: This is where the core ‘engine’ is loaded for the game. So you’re ready to make the latest, and greatest MineSweeper game.
Minesweeper game tutorial code#
But don’t worry, the game resources are included with the source code so you can get coding without spending time trying to create game resources. ImageEditorĪny image editor for creating png’s to use for the game’s graphics. It's built on the Panda Engine, which is an opensource html5 engine. It allows you to immediately see the code changes you're doing onscreen. Panda2 is a visual way of writing HTML5 Javascript games. Looks dead when the player presses a bomb square. Looks anxious when the player presses a square. If all the non-Bomb squares are cleared, then the player wins. These squares need to be created in the room, and the bomb needs to be randomly placed. If he manages to clear all the squares without clicking on a single mine, then he wins.Įach object will have the following behaviors: Game Objects Table 1.1Ĭould be next to a bomb. If he accidentally clicks on a mine, it blows up, and he loses the game. He can place a flag on top of mines by right-clicking to avoid clicking on them. The basic gameplay is the player has to uncover the whole field, except for the mines. There will be three basic game objects: A square, the playing field that contains all the squares, and the ‘Smiley’ faced button. Basic Designīefore we can get into writing any code, let’s take a look at the design of the classic Minesweeper.
It’s a simple design that can challenge the player again and again no matter how many times they play it. It’s a sometimes frustrating puzzle game, that mixes a bit of luck with a head for numbers. Minesweeper is a classic game, which just about everyone who’s ever had a computer has played before.