I finished up my Minesweeper game this weekend, so here it is!
There actually wasn’t all that much left to do. The first thing you’ll notice is the smiley face at the top. Clicking on it clears the game and brings up a new one. Also, every time you click, he opens his mouth in anticipation.
Flags are in too. Right clicking on an uncovered square places a flag over that square. Pretty simple.
When you win, the smiley face gets his requisite shades. Also, I decided to have all the mines turn into flowers.
And when you die, the smiley face dies, the mine you clicked on blows up, and all the mines in the game are revealed.
You can also change the width and number of mines. This one is what it looks like on expert.
So there we have it, minesweeper! It’s still not running as fast as I want to, but I’m not really sure if I want to optimize it. I think to make it run quicker, I’d have to gut everything and start over. It works, I can play it, and, other than the speed, I’m pretty happy with the result.
Also, I’m debating whether or not I want to post the code for it. I guess I could, but it won’t really work without the sprites, which would be a pain to upload in an organized fashion. Maybe sometime in the future I’ll upload it to the Mathworks website.