AS2 Minesweeper with multiple views
January 07, 2004

It's been a long time between posts for me. Mostly this is because our second child was born 6 weeks ago and so it means a lot less time in front of the computer (except of course during the day at work, and who has time to blog then?). Needless to say, I've been a little tired lately...but it has been a wonderful experience and we're thankful that he's doing well.

Over the holidays, I did sit down long enough to build my first AS2 project...minesweeper. In the process I did learn a few things and there were some stumbling blocks, but overall, once the learning curve levels off a bit, becoming more familiar with AS2 is definitely for the better.

As I built it, I tried to adhere to the MVC pattern, and in doing so, I thought, heck, why don't I create a second view for the game? You're probably all familiar with the flat "top-down" view of the original, but I also added an isometric view. Since the view is decoupled from the model and controller, it was very easy to do.

You can choose to play in either view, and you can even switch views right in the middle of the game.

The algorithm I wrote to plant mines and uncover multiple tiles seems to be fairly responsive, even on my P3 500.

I'm planning to add high score support whenever I can get around to it.

Play AS2MineSweeper.

Posted by philter at 09:10 PM | Comments Disabled