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)
When I run this, I get a crash. Something about a missing global "theme"
Sorry, still figuring things out and I used the wrong path :0
Should be fixed now :)
So cool to see this ported so quickly, very nice! Now it's feeling like a real desktop ;)
@kozm0naut Now we need someone to port Windows solitaire and NeXTSTEP chess :D
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 :)
Lovely project! I got an error towards the end of a game (version 2):
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
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.
@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 |
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.
@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 :)
@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?
@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
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.
@TeamPuzel
see above. Also another example:
Middle 2 should be 3
*EDIT: I see crossed out mine means incorrectly set flag. My bad!
@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
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!
@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? :)
You can now register picotron on site by using cd key in humble bundle download page @TeamPuzel.
Nice remake
I hope you add the emoji on top to reset, don't like how I can click anywhere to restart
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!
@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 :)
[Please log in to post a comment]