Hello, all! When someone says,“you can make anything as long as you can imagine it as a grid of tiles” my first thought is my favorite grid of tiles: Minesweeper! To get used to pulp and force myself to learn the ins and outs of some of its functions, I decided to implement it, and I had a lot of fun! There’s definitely A LOT of repeated code that could probably be cut down on, and due to my use of recursion to fill all zeroes the zero you clicked on is touching and any tiles that are touching any of those zeroes, I’m not super confident in this running perfectly on hardware? But my instinct is that the recursion isn’t THAT bad…
I’m attaching 3 files, the JSON of the full game with randomized minefields, the JSON of the game without randomized minefields so you can paint your own minefields in pulp if you want, and the pdx in case someone has a playdate and wants to chuck it on there to let me know how it runs. The game has an audio file that due to a glitch technically doesn’t fall in the 32 measure limit that pulp is supposed to impose, so I’m curious to see if that last note that’s outside of the 32nd measure plays on hardware.
There’s not a lot of good reusable code here, but if anyone wants to use any of the code, or any of the assets feel free, even remix your own funky not barebones minesweeper if you want.
I don’t have many plans to take this beyond where it is, other than adding difficulty options(i wrote the level generator with this in mind, so it would just be a matter of adding a menu that just changes the variable that decides how many mines to generate, and checking to make sure that variable isn’t bigger than the number of tiles on the playing field).
Sorry, that was a lot of rambling but it’s 4 am, so…
Minesweeper (1).json.zip (9.7 KB)
Minesweeper(pre-random).json.zip (6.0 KB)
Minesweeper_2022-01-22T104936.632304.zip (81.3 KB)