Last few days I've been working on a minesweeper game.
https://github.com/Sammy385/Minesweeper
That's the link to the GitHub repo. Feedback appreciated.
EDIT:
That repo's broken for some reason, this is the new one
https://github.com/Sammy385/Minesweeper_2
In the future I plan on:
1) making it so it opens nearby cells and shows how many nearby cells are bombs
2) giving it mouse input (at the moment everything is done with a keyboard)
3) making it object oriented (right now it's just a bunch of functions and variables)
How it's played:
You use the arrow keys to move the white box
Using CTRL switches between 3 states, Untouched, Safe and Suspected.
Untouched is self explanatory.
Safe marks a cell blue, it's for cells that you know are bombs and those can't be triggered.
Suspected does nothing at the moment, I plan on making it like "?" was in the original game.
Cells are opened by using SPACE, if a cell has no bombs it's marked green. If on the other hand it does have a bomb and you open it, all bomb cells are marked red and you can no longer move
PS.
I haven't made the bomb positions random just for some debugging reasons, I'll do that once I'm happy with everything else.
My minesweeper
My minesweeper
Last edited by Zodac on February 25th, 2017, 11:43 am, edited 2 times in total.
Re: My minesweeper
It looks good man. You really need those adjacency numbers there tho
The code is very procedural. Nothing wrong with that I guess, esp. if you're not comfortable with OOP. If you wanna learn OOP though (which tends to scale much better than pure procedural when you get into the realm of large game systems), this would be a good opportunity to practice it.
When T23 pops (already recorded not edited yet) you can see how I handle it. I also show event-driven mouse input and solving for the adjacency numbers.
Thanks for sharing bro
P.S.
If nothing else, you need to stop doing this:
Use the braces!!!
The code is very procedural. Nothing wrong with that I guess, esp. if you're not comfortable with OOP. If you wanna learn OOP though (which tends to scale much better than pure procedural when you get into the realm of large game systems), this would be a good opportunity to practice it.
When T23 pops (already recorded not edited yet) you can see how I handle it. I also show event-driven mouse input and solving for the adjacency numbers.
Thanks for sharing bro
P.S.
If nothing else, you need to stop doing this:
Code: Select all
for( ;; )
for( ;; )
code
Chili
Re: My minesweeper
Yea I know I should stop doing that, I was getting confused with all the {} while working at 2 am and I forgot to put them back in place...
Re: My minesweeper
Update on goal number 2. It's done, easier than I expected.
Re: My minesweeper
Yeah, once you get the hang of mapping one space to another that stuff is a synch. Good job man.
Chili