Log In  


Cart #minisweeper-9 | 2023-11-11 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
5

5


screen shake from doc_robs


1

i love it!! very nice interface, very clever and effective way to indicate the number of nearby bombs. definitely gonna be one of my go-tos!

if you're looking for suggestions, I'd love a way to pick like, themes or color schemes, if you're interested in doing that. just a thought!

thanks for sharing!


thanks for your comment! changing the theme is a good idea, I'll think about it


1
  • loved the yellow comments when changing the number of lives and bombs.
  • chording on a gamepad minesweeper! , surprisingly effective as long as you don't have to move too far.
  • explosion on first probe ! You heartless savage ;)
  • no flag autofill when the number of uncovered tiles+detonated bombs is equal to the number of bombs.

Bugs :

  • timer is broken big time (pun intended). Pretty hilarious to watch when trying to see how well I'm doing.
  • Strange things start to happen when placing more flags on the grid than there is bombs.

I'd love to have my high scores saved once the timer is fixed, let's see ...
With carddata, we have 256 bytes worth of storage.
bombs are in the 1-60 range and lives in the 1-5 range, so 300 different games.
floor(256x8/300)=6 bits of data per game board...
Enough to save a single number between 0 and 63, not enough to save even one time without initials.
Let's take the problem in reverse, If we save only one high score per game setting and no initials, and a high score is in the range 0-999 ala windows minesweeper, we need 10 bits per board, so floor(2568/10)=204 high scores...
Let's say no high score for chickens and the like:
1 life 11-60 -> 50 scores
2-5 lives 15-60 -> 46 scores
4 = 184
234 total, we're 30 short...

We could have just two high scores per number of bombs : damage less and with damage...
That's 120 HS tables, floor(256x8/120)=17 bits per table. That leaves room for 1 character (7 bits) on top of the single time for the board.

Oh, I won at max bombs in 10 minutes and 98 seconds, actually waited for a nice timer before finishing.


1

@RealShadowCaster, I really appreciate your comments. This is my first cart after making a flappy bird tutorial.

I secretly hope that I spent more time making it than you did testing it :D

I think i fixed

  • timer
  • flag count / flag toggle

I added

  • safe start: it will select a cell where the num is <= min num on the table starting from the middle out (I loved Silicon Valley btw)
  • cursor does not stop at the edge, but will appear on the other side (btw is there a short term for this behaviour? english is a 2nd language for me)
  • i cannot wrap my head around this statement... can you share a screenshot?
    no flag autofill when the number of uncovered tiles+detonated bombs is equal to the number of bombs. edit: do you mean when the no of uncovered tiles = flags left?

I'll look into saving, I didn't even know it was possible tbh. Thanks your ideas around that subject too!

Also I couldn't help and refactored a couple of things, so there might be new bugs now!!! :D

edit: finished with 60 mines??? how????


In this example the last two uncovered tiles could be auto filled with flags because there is only two flags left to put down. Don't bother with my confusing sentence, you already took care of the problem by counting red mines as flags.

Your solution to disallow flags when the counter has reached the max is not compatible with handling reds as flags : you can put wrong flags up to the max, then probe a mine and ... have the bomb unaccounted for. The solution : allow the FLG counter to go over the max, but highlight the counter (red ? blinking ?)

To win the 60 bombs, just retry until you win (took me around an hour). Being fast is important, but don't always do all the possible progress first (including the rare deductions that use the bomb counter that can take a lot of time):
If there is an area with say a 1/3 chance of losing and no possibility of getting more information later on, it's better to take a guess immediately, as you'll save the time to needlessly solve the rest if you lose on the guess. When stuck everywhere, choose the less risky tile.


Oh, the word you were searching for is wraparound: pac-man has horizontal screen wraparound , bubble bobble has vertical screen wraparound, asteroids has full screen or four-way wraparound, and minisweeper has grid wraparound.
Just love that you couldn’t wrap your head around my sentence, just after saying that you didn’t know the wraparound word :p


:D:D:D
I'm not sure I like the wraparound though. I keep sliding over to the other side by mistake...

Thanks for your suggestions again!

  • added the logic for auto-win if the remaining flags = remaining uncovered tiles.Mines below 10 never made much sense, but now 1 is an auto-win. Anyway, I left the lower limit at 1 for testing.

  • allowed flags to go over the limit, but only when triggering a mine

  • and again, couldn't keep myself from touching parts of the code that seemed to work OK, so expect new bugs...

I'm probably not commited enough to win at 60 tbh!


Wraparound is useful if you are aiming for a high score, and detrimental for casual play. This should definitely be an option up to the player. Saving the settings with cartdata might be a nice first step before handling high scores.

Ending screens (win or lose) are often not displayed, especially when the final move is chording as pressing two buttons with one thumb is slower than clicking one. Rather than quitting or restarting when a button is down, check that both buttons have been released first.

Ending screen when game is lost lacks info :

You could turn the misplaced flags (singular in the screenshot) to red and show the missing mines in black for example.

Lastly, you could add some animation for the tiles reveal when clicking on a zero.
Micorsoft Minesweeper did it by King's distance from the clicked zero. (1st frame just the clicked zero, 2nd frame all tiles touching the 0, 3rd frame all tiles touching zeros added in 2nd frame...)
Other have tried more advanced effects since like this cool one that is similar in spirit :

Another simpler good looking one is the circle approach : find all the tiles to be revealed and compute their square distance to the clicked tile ( (abs(x1-x2))²+(abs(y1-y2))² )
sort the tile coordinates per square distance and display in order, all the ones with same distance in the same frame.


Here the auto win triggered and cleared the three wrong flags when hitting the third red.


hey @RealShadowCaster, thanks for your comments again, I've had little time since, but decided to replace the whole update logic, because in its current state it's difficult to work with. I'll certainly add the changes you suggested for the game over screen + saving settings


I am brave chicken, I cross the road to see if there are any mines.



[Please log in to post a comment]