diff options
| author | jtsshieh <[email protected]> | 2017-08-02 22:03:57 -0400 |
|---|---|---|
| committer | jtsshieh <[email protected]> | 2017-08-02 22:03:57 -0400 |
| commit | d2286b7d68db20fae6bdb58078853379faf5ac08 (patch) | |
| tree | db1ca88e3b2e9a7df734597b22fd45c6e02b9d67 /TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Game.cs | |
| parent | 5fdd82f5f0069ad55662ff974a30d415543d3474 (diff) | |
| download | histacom2-d2286b7d68db20fae6bdb58078853379faf5ac08.tar.gz histacom2-d2286b7d68db20fae6bdb58078853379faf5ac08.tar.bz2 histacom2-d2286b7d68db20fae6bdb58078853379faf5ac08.zip | |
Minesweeper Scoring System
I didn't do acheivments because I couldn
t work out how to add one.
Diffstat (limited to 'TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Game.cs')
| -rw-r--r-- | TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Game.cs | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Game.cs b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Game.cs index 8adee8e..fd6704a 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Game.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Game.cs @@ -16,10 +16,11 @@ namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper private int _mines; private Panel _panel; private Square[,] _squares; - private Timer _timer; + public Timer _timer; private int _width; public bool ftime = true; public int Time; + public bool win = false; public Game(Panel panel, int width, int height, int mines) { @@ -27,15 +28,12 @@ namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper _width = width; _height = height; _mines = mines; + win = false; } private void Dismantle(object sender, EventArgs e) { - if(ftime == true) - { - ftime = false; - OnTick(); - } + Square s = (Square)sender; if (s.Dismantled) { @@ -66,6 +64,7 @@ namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper { _timer.Enabled = false; Panel.Enabled = false; + win = true; } } @@ -77,7 +76,6 @@ namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper private void Explode(object sender, EventArgs e) { _timer.Enabled = false; - foreach (Square s in _squares) { s.RemoveEvents(); @@ -114,6 +112,7 @@ namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper protected void OnDismantledMinesChanged() { + if (DismantledMinesChanged != null) { DismantledMinesChanged(this, new EventArgs()); @@ -184,14 +183,9 @@ namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper } OnDismantledMinesChanged(); - - _timer = new Timer(); - _timer.Interval = 1000; - _timer.Tick += new EventHandler(TimerTick); - _timer.Enabled = true; } - private void TimerTick(object sender, EventArgs e) + public void TimerTick(object sender, EventArgs e) { Time++; OnTick(); |
