![]() ![]() Building the Grid GeneratorĬreate a new empty object and name it Grid, and turn it into a prefab as well. We'll use this non-functional tile to build the playing field, and then later add functionality to it. Drag it over to the project folder to turn it into a prefab. Tiles that take neighboring tiles into account when reacting to mouse clicksĬreate a new Unity project.Tiles that can be interacted with via mouse clicks.Once all tiles with mines have been correctly marked, the game is won.įrom the rules above, we can extrapolate the different elements that our simple version of minesweeper will need. If there are no mines in the adjacent tiles, all adjacent tiles are uncovered too.Ī tile can marked by right-clicking on it, thereby putting a flag on it. If it is a mine, you lose if it is empty and at least one mine is in one of the bordering tiles, a number appears, showing the number of mines in the neighboring tiles. The field size varies by difficulty, and can range from 9x9 tiles (easy) to 16x30 tiles (hard), or any custom dimensions.īy clicking on a tile you "uncover" it. Minesweeper is a puzzle game in which you have to locate all the mines in a field. (Check out Build Arkanoid With Unity if you're new at it.) The source code can be downloaded, but is not necessary to complete this tutorial. You'll need Unity for this, and a basic understanding of it. Whether you're making a children's memory game or a complex strategy title, implementing the basic building blocks of Minesweeper are a great place to start. In the first part of this three-part tutorial series, we'll build a playing field you can then use to create your own version of the game. In this series I'll show you how to build a simple, basic version of the classic game Minesweeper, which is the perfect example to start from for creating your own puzzle games. Puzzle games often take place on a grid containing tiles that have behaviors and properties, and react to rules and inputs.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |