![]() The key type of this hashtable will be Vector2f and the value type will be Box. I will create a hashset inside Game class. This.uiBox = new RectangleShape(new Vector2f(16, 16)) Public Box(Vector2f position, bool isMine, Texture texture) ![]() There will be 400 boxes in total, and forty of them will be mines. Texture = new Texture("Assets/tileset.png") I added this image into the Assets folder I created in the project directory. I will take advantage of using the TextureRect feature that SFML provides. In order, there is the image representing an unopened box, opened boxes indicating the number of mines 1,2,3,4,5,6,7 and 8. representative mine image, an unopened and checked box, and and finally an empty opened box image. Instead of using them all individually, I combined them into a tileset. You can download it if you want to use it: ![]() I quickly made this texture with Aseprite. I created a tileset that I will use in the game. I think we can understand this better by making the game. Clicking on these empty boxes will open other empty boxes around it. I think I will solve this situation with the Breadth First Search algorithm. If the player is sure that a box contains a mine, the player will mark it with a flag.Īdapting all these rules to the game may sound a bit complicated, but it is actually quite simple. So what are the basic rules of the minesweeper game? First of all, if the person playing the game clicks on the box containing the mines, it is game over. If a number comes out of the box that the player pressed, which can be 1, 2, 3, 4, 5, 6, 7, 8, then it means that there are as many mines as that number around the opened box. Frankly, I will try to make the game based on this. First of all if you've played in a minesweeper before, You know more or less how minesweeper works. In this post, We will see how we can make a minesweeper game clone.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |