AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Simple minesweeper mine4/20/2024 ![]() I could’ve chosen a different game if I simply wanted to build something interactive and realtime. I’ve been wanting to try the shiny new stuff and stay up to date. I briefly tried liveview when it first came out. My most familiar stack is building frontend with Angular and using phoenix as an API backend. Most relevant code at mine_sweeper/lib/mine_sweeper_web/live/session_live at main We have a mine counter, we have a timer, we have a way to indicate when the game is over or won, and even got a nice bomb emoji for the mines (couldn’t find a mine, sorry).TLDR: built with liveview and other recent tools. Well, I think we made it and achieved our goals for this post! It might be better to have a game state and have effects to it, but we will save that, and others, to the refactor phase. We first render the game panel in the header:Įnter fullscreen mode Exit fullscreen modeĪnd when the game is over for any reason, we clear the interval. The counter starts from the initial number of total mines on the board, and each time the player marks a tile, the mine count is decreased accordingly, even if the mark is not actually on a Tile which has a mine in it. The Minesweeper game has a game panel, which holds, among other things, the mines counter. The code can be found in this GitHub repository: Hey! for more content like the one you're about to read check out on Twitter □ We have plenty to do, so let’s get on to it! Plus, we'll introduce a game-ending logic and a handy new Timer component that will keep track of how long you've been playing until the bombs start detonating or you've marked all the mines. We're going to spice things up by adding a mine counter to keep track of those pesky bombs and help you keep count of the ones you've marked. ![]() In this post, we aim to incorporate gamification elements into the game to make it more engaging and enjoyable for users. In the second part, we concentrated on the recursive iteration process required to implement the "zero-opening" functionality. In the first part, we constructed the game board using a flat array and mathematical operations. Welcome to the 3rd installment of the “Creating a Minesweeper Game in SolidJS” post series. ![]()
0 Comments
Read More
Leave a Reply. |