diff options
| author | lempamo <[email protected]> | 2017-08-07 20:46:26 -0400 |
|---|---|---|
| committer | lempamo <[email protected]> | 2017-08-07 20:46:26 -0400 |
| commit | ffebe68546826958b2920c99540cb72067f42cad (patch) | |
| tree | ea0d8f003db32773664a68fa6d4aebd1319401e3 /TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Game.cs | |
| parent | 1a7baf7a0ed6a9eaa4549cc2ec313dcef0311c0b (diff) | |
| download | histacom2-ffebe68546826958b2920c99540cb72067f42cad.tar.gz histacom2-ffebe68546826958b2920c99540cb72067f42cad.tar.bz2 histacom2-ffebe68546826958b2920c99540cb72067f42cad.zip | |
minesweeper complete :smile:
Diffstat (limited to 'TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Game.cs')
| -rw-r--r-- | TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Game.cs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Game.cs b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Game.cs index be3f1c8..3b76e27 100644 --- a/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Game.cs +++ b/TimeHACK.Main/OS/Win95/Win95Apps/MineSweeper/Game.cs @@ -21,13 +21,15 @@ namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper public bool ftime = true; public int Time; public bool win = false; + private WinClassicMinesweeper _window; - public Game(Panel panel, int width, int height, int mines) + public Game(WinClassicMinesweeper window, Panel panel, int width, int height, int mines) { _panel = panel; _width = width; _height = height; _mines = mines; + _window = window; win = false; } @@ -63,6 +65,8 @@ namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper private void Explode(object sender, EventArgs e) { + _panel.Enabled = false; + _window.button1.BackgroundImage = Properties.Resources.WinClassicMinesweeperSad; if (_timer != null) _timer.Enabled = false; foreach (Square s in _squares) { @@ -76,6 +80,7 @@ namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper s.Button.BackgroundImage = Properties.Resources.minesweepSquareWrong; } } + _window.button1.BackgroundImage = Properties.Resources.WinClassicMinesweeperSad; } public int Height @@ -164,6 +169,8 @@ namespace TimeHACK.OS.Win95.Win95Apps.MineSweeper Square s = new Square(this, x, y); s.Explode += new EventHandler(Explode); s.Dismantle += new EventHandler(Dismantle); + s.Button.MouseDown += (send, args) => { if (_panel.Enabled) _window.button1.BackgroundImage = Properties.Resources.WinClassicMinesweeperGasp; }; + s.Button.MouseUp += (send, args) => { if (_panel.Enabled) _window.button1.BackgroundImage = Properties.Resources.WinClassicMinesweeperSmile; }; _squares[x, y] = s; } } |
