Log In  

Cart #picotron_minesweeper-8 | 2024-03-26 | Embed ▽ | License: CC4-BY-NC-SA
25

A port of my recent pico-8 minesweeper to Picotron.

I want it to fully adjust to the system theme, for now it just uses it for the mine counter :)

UPDATE 0.2:

  • No longer crashes on continue
  • The time is displayed correctly

UPDATE 0.3:

  • Beginner, intermediate and expert difficulty selection from the menu (but windows don't resize automatically yet)
  • Lots of windows at once
  • Game doesn't crash on victory
  • Added missing sound effects

UPDATE 0.4:

  • Changed how the program creates new windows, now new instances use the correct about menu

UPDATE 0.5:

  • Windows now open in a cascade from the previous window (but difficulties beyond beginner don't yet open with the correct size)
  • There is now a persistent scoreboard for the three standard difficulties (custom game and scoreboard coming soon)

UPDATE 0.6:

  • Windows now open at the correct size for their difficulty

UPDATE 0.7:

  • Fixed a sound bug that started happening after the Picotron "c" update

(new) UPDATE 0.8:

  • Custom game! (number input is not too convenient due to picotron input limitations but it works — there's also no scrollbars for the board so don't make one too big yet)
P#143106 2024-03-15 13:22 ( Edited 2024-03-26 17:34)

When I run this, I get a crash. Something about a missing global "theme"

P#143193 2024-03-15 20:16

Sorry, still figuring things out and I used the wrong path :0
Should be fixed now :)

P#143194 2024-03-15 20:26 ( Edited 2024-03-15 20:27)
1

So cool to see this ported so quickly, very nice! Now it's feeling like a real desktop ;)

P#143196 2024-03-15 20:51
1

@kozm0naut Now we need someone to port Windows solitaire and NeXTSTEP chess :D

P#143198 2024-03-15 21:14
1

Oh no, I was about to make one as well! What's a GUI OS, fantasy or otherwise, without a Minesweeper somewhere in the apps folder? :)

Good job. Now somebody needs to make the Klondike thingy and we're 100% feature complete ;)

EDIT: It crashed Picotron on me while placing the last flag - kinda hard to tell whether it's your fault or the alpha's :)

P#143221 2024-03-15 23:03 ( Edited 2024-03-15 23:06)
1

Lovely project! I got an error towards the end of a game (version 2):

/desktop/minesweeper.p64/game.lua:295: attempt to index a nil value (global 'mode')
stack traceback:
 /desktop/minesweeper.p64/game.lua:295: in method 'win_check'
 /desktop/minesweeper.p64/game.lua:157: in method 'update'
 /desktop/minesweeper.p64/main.lua:44: in function '_update'

P#143219 2024-03-15 23:03

I am experimenting with creating multiple windows to implement the menu, the app just opens itself with different argv (not sure if that's the best way but it works)

I guess now I'll have to figure out the picotron gui library

@gorbsleeves Uh oh, when I ported this from pico-8 I renamed types to pascal case, must have missed that one lower case usage. I just haven't tested winning yet, there's so many cool things to play with :D

P#143222 2024-03-15 23:11 ( Edited 2024-03-15 23:15)

Cool, I think there is a bug as sometimes count says 1 while there are 2 bombs (ie one in unexplored area up and one to the left).

.x.
x@.
...

sometimes similar issue for diagonal.

P#143265 2024-03-16 06:14

@Nunuvin Could you send a screenshot? I can't get that to happen and the code that draws numbers seems too simple to break:

elseif tile.revealed then
    local num_mines = 0
    for neighbor in all(tile.neighbors) do
        if (neighbor.mined) num_mines += 1
    end
    spr(8 + num_mines, tile.x * 8 + ox, tile.y * 8 + oy)
end
P#143274 2024-03-16 08:34

Game works a lot better now, thanks :-] Found another little bug, I get a runtime error if I right click on the window where there aren't any tiles because it's trying to place a flag.

P#143304 2024-03-16 13:45
1

@gorbsleeves Thanks! Oddly enough both the flag and chord functions already checked for it, but in a totally random place earlier in the update code I was using the current tile in a spaghetti way.

It took me ages to find because picotron crashes on nil indexing currently D:
Is your picotron somehow more stable since it told you it's a runtime error? I had to go debug it in the pico-8 version to see

Should be fixed in 0.5 :)

P#143315 2024-03-16 14:41

@TeamPuzel I agree the code is very straightforward and I am also unsure why this is happening.
It is usually squares with value of 1 which have this issue. 0 or 2+ usually are behaving as expected.

Also did you encounter any issues connecting picotron from HB to lexaloffle site?

P#143401 2024-03-17 00:01 ( Edited 2024-03-17 00:03)

@Nunuvin Huh, I didn't know it was possible to connect picotron here, where would I do that?

Maybe it's because it's almost 2 am, but I've been looking at the screenshot for over 5 minutes now and It appears completely normal to me :0

P#143406 2024-03-17 00:28

Maybe its not the best example (didnt get strictly horizontal and vertical in a while). Here the diagonal mine count is incorrect. See bottom 2 rows.

111
2F111
F22**

The 11 have 2 mines beside each 1.

P#143408 2024-03-17 00:34 ( Edited 2024-03-17 00:35)

@TeamPuzel
see above. Also another example:

Middle 2 should be 3

*EDIT: I see crossed out mine means incorrectly set flag. My bad!

P#143409 2024-03-17 00:37 ( Edited 2024-03-17 00:39)

@Nunuvin Ah I see — you're right, it's not the most intuitive design ever, I just made the tiles as faithful to the original as possible but in a pico-8 style

It would probably be more intuitive if you got a crossed out flag instead but I don't want to change it too much — I could add a rules menu though

P#143411 2024-03-17 00:48
1

Reading through the code gave me a big case of the imposter syndrome. Very nice architecture, very fancy way of designing that whole thing. And thanks for sharing!

P#143475 2024-03-17 10:20

@taxicomics Thank you :D

I love painfully strict languages such as Zig, Swift or Rust, so I'm very much still thinking with their type systems when using Lua — I assume that's what you're referring to? :)

P#143558 2024-03-17 19:06
1

You can now register picotron on site by using cd key in humble bundle download page @TeamPuzel.

P#143922 2024-03-20 02:49
2

Nice remake
I hope you add the emoji on top to reset, don't like how I can click anywhere to restart

P#144091 2024-03-21 23:21
1

I have spent arguably too much time playing your Minesweeper on Picotron during unproductive work video meetings. This is an essential game and your version works so well on Picotron. Thank you!

P#144092 2024-03-21 23:36

@Luka tv That is a cool suggestion! I originally cut the emoji because it didn't fit on the tiny pico-8 display — now there is no such limitation, and while I like the clean look of the current version there's no reason why I can't add a setting to use the classic UI with the emoji and 7 segment displays. I would first like to add the custom game UI, I'll return to the emoji once I deal with that. (I'm in the middle of a different Picotron project so it might take a few days)

I'm also considering an endless mode, where the board is infinitely generated in all directions and the goal is to reveal as many tiles as possible rather than just lower the time

@ahrotahn I'm happy that you're enjoying the game, I spent a lot of time working on it :)

P#144097 2024-03-22 00:58

[Please log in to post a comment]