In the summer semester I was taking a class in which we were asked to apply software engineer principles using a group project. Due to the limited time and resources (3-people group), we decided to do a small project, which is a replica of the iconic Windows game Mine Sweeper. Another reason we pick up this game is because each team member is more or less familiar with the game so we don't have to spend a lot of on the requirement part.
It is a little surprise that the original version of game once shipped by default with Windows is now actually hard to find. There are updated versions of the game in the Store, but they are very fancy. Finally, we found an online version of the game (http://minesweeperonline.com/) that is quite close to original game. We use this version as the requirement benchmark. The user of game should be able to do the following:
I made the overall design which follows strictly the MVC pattern.
The class diagram was generated using Eclipse plugin – ObjectAid.
The model/data part is the center of any system. We decide to use two integers to presents the status of each grid, one for the cover and the other for the underlining mines or number of mines in its neighbor.
After the model was finalized, we started working separately on parts and I was mainly working the View part.
The most tricky issue in View part is how to differentiate the Left+Right mouse click from the Left or Right only click. The Left+Right click is actually two separate events. If you don't add specific logic, it can be identified as Left+Right, but always followed by additional Left or Right click event. It held me for 2 days until I saw a solution from another developer using a set of Booleans to identify the states of the mouse and eventually differentiate the both-click from single click.
I setup the project repository on my Github account and we use two branches(dev/master) and Collaborator mode which is perfect for a small team working on the same repository.
Unit tests were done using JUnit on the Model and Controller part and integration tests were done manually.
Although this is a very small project, but I do achieve a lot during the process.
Credits are given to my teammates Robert and Harika
and this project uses icons from
https://github.com/mengzhinan/MineGame