![]() MineSweeper show - brings up game screen I tried to get the controls as close to the original as possible, if there are requests for additional controls leave a message below and I will try to accommodate you. Right Click Minimap Icon - Show leaderboards and options panel Left Click Minimap Icon - Show game screen Left and Right Click on revealed square -or- Middle Click - Reveal surrounding squares if number of surrounding flags matches number of surrounding bombs Note: Your friends and guild members will have to download version 2.2 for their new high scores to appear on your leaderboards. Choose to hide game when brought into combat.Choose to display game on death while solo, in party, in raid, in battleground, or in arena.Pauses game on minimize to save for later.Personal Leaderboards with enhanced statistics.Choose to automatically send messages to Guild, Friends, Party, Raid, or Say chat when you achieve a new high score.Find out who the best "sweeper" is among your friends and guild members and keep track of your personal bests with stats like clicks/s and 3BV. I hope you enjoyed this article and sample.Īny suggestions and feedback for improving this article is most welcome.A simple addon that brings the classic game of Minesweeper to WoW with all of the functionality of the original Windows game. Examine it by stepping trough the code using the VS.NET debugger. It demonstrates how object orientation really makes it easy. Writing the Minesweeper game was a lot of fun. Mines are dismantled (marked) or explode which is reported to the Game object using events. The number of surrounding mines is calculated (cascading). These events trigger the real game logic. This class contains a normal WinForm Button object which Click and MouseDown events are captured. The events DismantledMinesChanged and Tick are used to notify the MinesweeperForm that is has to update the GUI. It has a Timer which is used to calculate the elapsed gametime. The mines are randomly placed in the squares. This class contains a multidimensional array of Square objects which is initialized in the constructor. It contains a Panel control in which the Game object generates the Squares. It also updates the Timer and Mines display. This class creates a Game object when the Start button is clicked. The application is build using 3 objects: a Form, a Game which holds an array of Square objects. I have reduced the complexity a bit by eliminating the flag-icon and all menu options. The whole program is less then 400 lines of code! See the result in the downloadable zip file. Made an OO design and then went programming. I have always wondered how hard it would be to write a game in C#. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |