v1.2, by nayz
A fully-featured port of Minesweeper to PICO-8
PICOSWEEPER is something I've worked on for a little while, and has lots of options and customization, plus some quality of life features. This is the biggest project I've worked on yet (baby steps), so I hope you enjoy!
Don't hesitate to give me any feedback, and please let me know if you find any bugs. Thanks for playing!
Changelog
A very good implementation of minesweeper :
pad and mouse support, chording, flood fill, mine counter, informative game over screen, custom board. Great.
What could still be added :
High score table
Multiplayer
Chording flag check
Differentiation between number cells revealed by you and those revealed by the computer when the game is over.
Oh, there's a small exploit : you win by placing all the flags correctly.
When in end game you get a 50/50 chance, you can place the last flag on one of the two remaining cells. If you win, great, otherwise, move the flag to the other candidate cell and win. No risk taken. I honestly don't mind cheating that way, as long as there's no more possible deduction, and no reason to choose a cell over another one.
@RealShadowCaster thank you! good list of suggestions, i'll look into these. could you elaborate on what you mean by "chording flag check"?
as for that exploit, i noticed that too, but figured it was minor enough to be alright =3
wait, i think i know what you mean now. like only allowing chording if there are the correct number of flags placed around the mine?
@Nayz, yep, that's it. It's a bit more forgiving, since it saves you if you placed too many flags, but it doesn't give you any hint, and will happily reveal bombs if you chord a tile with misplaced flags. In that case, it's nice to have a misplaced flag marking for the game over screen.
About the high score table, because cartdata is limited to 256 bytes, you can limit the table to a few pre-defined board and count sizes, or you can use cstore for more data, but it's a bit trickier and a BBS cart can only write to the local copy of itself. cstore based high score changes are lost every time the cart is updated, contrary to cartdata that has a name space independent from the carts.
@RealShadowCaster i see, thank you :) good to know, about the cartdata. that will be difficult to store, i think... might just only track high scores for the default board size. or do you think it would be possible to use cstore to store data in a separate cartridge, whose sole purpose is to store said data?
If the data you want to save is more than 256 bytes, you need cstore.
Using a different cart for the save than the main one used for the game makes sense, but it's normally only an option for a local project where the cart has writing right to its folder, or for an HTML export of a multi-cart project.
For BBS/Splore, the simplest is to use an unused part of the cart for the save. For example, the map data makes sense for a minsweeper game. (You can use mset or poke to write to it)
If what's available in the main cart is not enough and you really need the space from another cart, there's still a way :
A cart can call another one. When you do, the old cart is replaced by the new one in memory, everything LUA related is also lost, but the 32K of high memory stays untouched and can be used a communication channel between the two carts.
Main cart could handle the game, and when it wants to submit a high score or get the high score table, it would write that query in high memory and call the high score cart.
The high score cart would update the high score table with cstore if needed, copy the high score data from low mem to high mem, and call the main cart.
The main cart would see that the high score data is available in high memory and display it.
Each read or write to the high score table would display the floppy disk load icon twice, but it's doable.
It would make more sense for a game like a farming simulator where you'd need to save the entire map that can be planted however the player wants, but can't be save directly to the cart because the starting position is needed when starting a new game. This feels a bit convoluted for minesweeper... Unless you need more storage space and don't mind the extra hoops to jump through.
thank you for the explanation! i think i'll see if i can figure out what you suggested, using unused cart space.
[Please log in to post a comment]