From c49c7ac9c68a1815910a80afc45b43e05009137f Mon Sep 17 00:00:00 2001 From: lempamo Date: Sun, 26 Feb 2017 15:02:40 -0500 Subject: [PATCH] more shiftsweeper stuffs --- ShiftOS.WinForms/Applications/ShiftSweeper.cs | 53 ++++++++ .../Properties/Resources.Designer.cs | 120 ++++++++++++++++++ ShiftOS.WinForms/Properties/Resources.resx | 36 ++++++ ShiftOS.WinForms/Resources/SweeperTile0.png | Bin 0 -> 259 bytes ShiftOS.WinForms/Resources/SweeperTile1.png | Bin 0 -> 285 bytes ShiftOS.WinForms/Resources/SweeperTile2.png | Bin 0 -> 286 bytes ShiftOS.WinForms/Resources/SweeperTile3.png | Bin 0 -> 284 bytes ShiftOS.WinForms/Resources/SweeperTile4.png | Bin 0 -> 285 bytes ShiftOS.WinForms/Resources/SweeperTile5.png | Bin 0 -> 287 bytes ShiftOS.WinForms/Resources/SweeperTile6.png | Bin 0 -> 292 bytes ShiftOS.WinForms/Resources/SweeperTile7.png | Bin 0 -> 282 bytes ShiftOS.WinForms/Resources/SweeperTile8.png | Bin 0 -> 293 bytes .../Resources/SweeperTileBlock.png | Bin 0 -> 185 bytes .../Resources/SweeperTileBomb.png | Bin 0 -> 284 bytes .../Resources/SweeperTileFlag.png | Bin 0 -> 243 bytes 15 files changed, 209 insertions(+) create mode 100644 ShiftOS.WinForms/Resources/SweeperTile0.png create mode 100644 ShiftOS.WinForms/Resources/SweeperTile1.png create mode 100644 ShiftOS.WinForms/Resources/SweeperTile2.png create mode 100644 ShiftOS.WinForms/Resources/SweeperTile3.png create mode 100644 ShiftOS.WinForms/Resources/SweeperTile4.png create mode 100644 ShiftOS.WinForms/Resources/SweeperTile5.png create mode 100644 ShiftOS.WinForms/Resources/SweeperTile6.png create mode 100644 ShiftOS.WinForms/Resources/SweeperTile7.png create mode 100644 ShiftOS.WinForms/Resources/SweeperTile8.png create mode 100644 ShiftOS.WinForms/Resources/SweeperTileBlock.png create mode 100644 ShiftOS.WinForms/Resources/SweeperTileBomb.png create mode 100644 ShiftOS.WinForms/Resources/SweeperTileFlag.png diff --git a/ShiftOS.WinForms/Applications/ShiftSweeper.cs b/ShiftOS.WinForms/Applications/ShiftSweeper.cs index d7c22b4..70c69d7 100644 --- a/ShiftOS.WinForms/Applications/ShiftSweeper.cs +++ b/ShiftOS.WinForms/Applications/ShiftSweeper.cs @@ -19,6 +19,7 @@ namespace ShiftOS.WinForms.Applications { private bool gameplayed = false; private int mineCount = 0; + private int[,] minemap; public ShiftSweeper() { @@ -59,6 +60,58 @@ namespace ShiftOS.WinForms.Applications default: throw new NullReferenceException(); } + makegrid(); + } + + private void makegrid() + { + Random rnd1 = new Random(); + minemap = new int[minefieldPanel.ColumnCount, minefieldPanel.RowCount]; + + for (int x = 0; x < minefieldPanel.ColumnCount; x++) + { + for (int y = 0; y < minefieldPanel.RowCount; y++) + { + minemap[x, y] = 0; + minefieldPanel.Controls.Add(makeButton(x, y), x, y); + } + } + } + + private Button makeButton(int col, int row) + { + Button bttn = new Button(); + + bttn.Text = ""; + bttn.Name = col.ToString() + " " + row.ToString(); + Controls.AddRange(new System.Windows.Forms.Control[] { bttn, }); + bttn.Click += new System.EventHandler(bttnOnclick); + bttn.MouseDown += new MouseEventHandler(mouseDwn); + bttn.MouseUp += new MouseEventHandler(mauseUp); + bttn.MouseHover += new EventHandler(mauseHov); + bttn.BackgroundImage = Properties.Resources.SweeperTileBlock; + + return bttn; + } + + private void mauseHov(object sender, EventArgs e) + { + pictureBox1.BackgroundImage = Properties.Resources.SweeperNormalFace; + } + + private void mauseUp(object sender, MouseEventArgs e) + { + pictureBox1.BackgroundImage = Properties.Resources.SweeperNormalFace; + } + + private void mouseDwn(object sender, EventArgs e) + { + pictureBox1.BackgroundImage = Properties.Resources.SweeperClickFace; + } + + private void bttnOnclick(object sender, EventArgs e) + { + } } } diff --git a/ShiftOS.WinForms/Properties/Resources.Designer.cs b/ShiftOS.WinForms/Properties/Resources.Designer.cs index 05c6c07..beef6ff 100644 --- a/ShiftOS.WinForms/Properties/Resources.Designer.cs +++ b/ShiftOS.WinForms/Properties/Resources.Designer.cs @@ -1026,6 +1026,126 @@ namespace ShiftOS.WinForms.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap SweeperTile0 { + get { + object obj = ResourceManager.GetObject("SweeperTile0", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap SweeperTile1 { + get { + object obj = ResourceManager.GetObject("SweeperTile1", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap SweeperTile2 { + get { + object obj = ResourceManager.GetObject("SweeperTile2", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap SweeperTile3 { + get { + object obj = ResourceManager.GetObject("SweeperTile3", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap SweeperTile4 { + get { + object obj = ResourceManager.GetObject("SweeperTile4", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap SweeperTile5 { + get { + object obj = ResourceManager.GetObject("SweeperTile5", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap SweeperTile6 { + get { + object obj = ResourceManager.GetObject("SweeperTile6", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap SweeperTile7 { + get { + object obj = ResourceManager.GetObject("SweeperTile7", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap SweeperTile8 { + get { + object obj = ResourceManager.GetObject("SweeperTile8", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap SweeperTileBlock { + get { + object obj = ResourceManager.GetObject("SweeperTileBlock", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap SweeperTileBomb { + get { + object obj = ResourceManager.GetObject("SweeperTileBomb", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap SweeperTileFlag { + get { + object obj = ResourceManager.GetObject("SweeperTileFlag", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/ShiftOS.WinForms/Properties/Resources.resx b/ShiftOS.WinForms/Properties/Resources.resx index aad84ee..8c4b52b 100644 --- a/ShiftOS.WinForms/Properties/Resources.resx +++ b/ShiftOS.WinForms/Properties/Resources.resx @@ -403,4 +403,40 @@ ..\SystemIcons\iconshutdown.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\SweeperTile0.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\SweeperTile1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\SweeperTile2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\SweeperTile3.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\SweeperTile4.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\SweeperTile5.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\SweeperTile6.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\SweeperTile7.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\SweeperTile8.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\SweeperTileBlock.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\SweeperTileBomb.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\SweeperTileFlag.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/ShiftOS.WinForms/Resources/SweeperTile0.png b/ShiftOS.WinForms/Resources/SweeperTile0.png new file mode 100644 index 0000000000000000000000000000000000000000..c48c3774ee52a73b073ae8dd93d7080d0ca9ddab GIT binary patch literal 259 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G}c0*}aI1_r*vAk26?e?qM z&(PR}Il2m{sMyoRF~q`u>$yO#0}4FM7w-MPq?dfQUG=a?XhjOkVV*gK5k24MocL0^ z;g0VI{q;s?_1`?|TBpt4O{3Xiiy rZkqyEVm^I0=f9_+%eeJz)Q>TT-Jad}#Xv(8Xg!0ctDnm{r-UW|73EnX literal 0 HcmV?d00001 diff --git a/ShiftOS.WinForms/Resources/SweeperTile1.png b/ShiftOS.WinForms/Resources/SweeperTile1.png new file mode 100644 index 0000000000000000000000000000000000000000..06819d0930630268a4906b60adc88f02c8bd8dbd GIT binary patch literal 285 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G}c0*}aI1_r*vAk26?e?qM z&(PR}Il2m{sMpiQF~q`uYhNQ@gMxt5-~aQ?OfuyTU&_qMk15#h6JY0a%2j<&AwN&K z>>2&~O67e8qW3Ny{NV5Jmg&A^^TWwsFU_;w%Pf5@@~Gd$b8U=SSHAM)NGym6pMb{s z`rEh4o!xBB=h-`!mmg@m{GpF8XGhDOqXpLw{`oZBysqM*Wzaqb-fDK01H1LofDU8u MboFyt=akR{0L;K=<^TWy literal 0 HcmV?d00001 diff --git a/ShiftOS.WinForms/Resources/SweeperTile2.png b/ShiftOS.WinForms/Resources/SweeperTile2.png new file mode 100644 index 0000000000000000000000000000000000000000..eec00e9d4ea3f0ac3171f5ef3510f2e25eff570e GIT binary patch literal 286 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G}c0*}aI1_r*vAk26?e?qM z&(PR}Il2m{sL#{IF~q`uYhNQDvm%ev-~aQ=&U88+v(bO<5torEts7wLvoe3~hjYsl zeq1^D@6*)sXY%)2%S%3dUOI7Q%{keZ$rhVb?gz3P=6vNS%G}c0*}aI1_r*vAk26?e?qM z&(PR}Il2m{sK?XAF~q`uYhNQ@gMxt5-~aQ?j513e+DzZL_o1S>ZoplimCMU2o?99G zd8H6Puk!iN!=XFe*$+>@)M6{W?WU*oo0ZJc+dg}|$p}xA-WPB*M)t;sd2_cMo_EG< zkMZ&wf$U~A3yaE)Zf`iNd~}}GhD2-Yk8zwkc`q0A^X2Stxl!E~FZ<-Q@%uj?4%bep ZV$gdb&oe<+GYRM}22WQ%mvv4FO#rG4XpaB@ literal 0 HcmV?d00001 diff --git a/ShiftOS.WinForms/Resources/SweeperTile4.png b/ShiftOS.WinForms/Resources/SweeperTile4.png new file mode 100644 index 0000000000000000000000000000000000000000..f8c3d2b7d75ea3830f1fb17a9064f0956923f7a3 GIT binary patch literal 285 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G}c0*}aI1_r*vAk26?e?qM z&(PR}Il2m{sMpiQF~q`uYab)m0Rzopr074FDmH+?% literal 0 HcmV?d00001 diff --git a/ShiftOS.WinForms/Resources/SweeperTile5.png b/ShiftOS.WinForms/Resources/SweeperTile5.png new file mode 100644 index 0000000000000000000000000000000000000000..2b2e4fd5117821f9ec1cecdbe3b2057c02501705 GIT binary patch literal 287 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G}c0*}aI1_r*vAk26?e?qM z&(PR}Il2m{sNd7YF~q`uYach)0RtYV>i^#5W~(Q#Ugm$>(jLka-S{fiD|gq!x!(_d zx^nPW#k0BZ<=-8$wz?2Mt8;e+drD^Ik_vbBO+xK*3^Vg4OtnL3i cwDqcGC}p;J=c_Mp6X-MsPgg&ebxsLQ00UoYo&W#< literal 0 HcmV?d00001 diff --git a/ShiftOS.WinForms/Resources/SweeperTile6.png b/ShiftOS.WinForms/Resources/SweeperTile6.png new file mode 100644 index 0000000000000000000000000000000000000000..d8698d069c779edc907a6f2003e5d0f6e7c6009a GIT binary patch literal 292 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G}c0*}aI1_r*vAk26?e?qM z&(PR}Il2m{Xo{zcV~BnA1_K`E@BjVJZ_x|#zNUHZz(lo_jOJfyQRZ(y9IV{% z=hcIs6;GRg%kOJ_|03a+>Ura*u_rctiP7A@m^t!SZqhmr>&Pmzqkac@WlvmsKXXUt z?Fp$bcLvqDvv2xx`$)`J&C{1QYnH8g?hEAa7ApTKJK^b7&8NO43a7)Dlz;!Uy7~Fz hsr+?64%cp}W8f8WdU03I*%IhJ22WQ%mvv4FO#o^3bJPF; literal 0 HcmV?d00001 diff --git a/ShiftOS.WinForms/Resources/SweeperTile7.png b/ShiftOS.WinForms/Resources/SweeperTile7.png new file mode 100644 index 0000000000000000000000000000000000000000..ff02afd02a5818e86b5a5ec86e97c32dcadeb97e GIT binary patch literal 282 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G}c0*}aI1_r*vAk26?e?qM z&(PR}Il2m{sLRvEF~q`uYab(Di-G|2&;QFeYMCyb=B#`@C8#_>nRR8iX6gB^ygBky z;-zi&+q`!Be`tF_KkujcX%B7hGY86jUjIW*+QqV^P`!AHv&7u3j#C7Ct7k6Wv#@YI z@1i#sdd{WxeR49ky3Q6DXT12{#?Ko4GXvj$n8UlMruFUDPub1Sr>EcjahUsh;48MA XNM5-d)5o)bu43?X^>bP0l+XkKHA!Yg literal 0 HcmV?d00001 diff --git a/ShiftOS.WinForms/Resources/SweeperTile8.png b/ShiftOS.WinForms/Resources/SweeperTile8.png new file mode 100644 index 0000000000000000000000000000000000000000..9703491b82d41eaf3bde9df577677583c19d328a GIT binary patch literal 293 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G}c0*}aI1_r*vAk26?e?qM z&(PR}Il2m{XsV}+V~Bw{IIF_D~q9>&@INZXXT8yC{N$t z{NQ%Wd;R#QpMJLcueDbF^I5fQ`JTmlujr<{4|zXjL+c#pSF-wdoxTO6^<{@05-WPQ zWN#IF^oe^b?`bA-Tee@Zj@#AxX5kr`>uXwcpWN}R{>r!QLxNwax_Zt-<>|YPYi57= j`*d~8zr+0BE6?yNIQreWt^LXp=s*TfS3j3^P6NS%G}c0*}aI1_r*vAk26?e?qM z&(PR}Il2m{NYm5BF~q_@nW5=_$T6P(D_Pxmm&o);d00xAPAD?SQh3@>#umhH{D+-k YD_7WunatNN0yQysy85}Sb4q9e0EWUb#Q*>R literal 0 HcmV?d00001 diff --git a/ShiftOS.WinForms/Resources/SweeperTileBomb.png b/ShiftOS.WinForms/Resources/SweeperTileBomb.png new file mode 100644 index 0000000000000000000000000000000000000000..c03a4a3283ca2a4ec133c0985dfb05a25bed69ca GIT binary patch literal 284 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G}c0*}aI1_r*vAk26?e?qM z&(PR}Il2m{sK?XAF~q`uYab(Dg8~op&;QFeDyc4>#vnL7rt7+(=Zu;eQ{G!noci41 zr|H38pLDeUa+g1}Rg?IaDY-NKDRh literal 0 HcmV?d00001 diff --git a/ShiftOS.WinForms/Resources/SweeperTileFlag.png b/ShiftOS.WinForms/Resources/SweeperTileFlag.png new file mode 100644 index 0000000000000000000000000000000000000000..11cedbec49bdc2c94f6f5452ec6981c81f6f5daf GIT binary patch literal 243 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G}c0*}aI1_r*vAk26?e?qM z&(PR}Il2m{DB07+F~q|EZJ#680Rs+}zyFu#YVJOGVe7UlcZ@bHKj>)v@!8DskCq+H z*<3rUPI$~=(&PUW;mcS)-KJ_5Q{FV270Vi;|0K2?&*Iu);~~)*eBi3%p@=f(?{*$# i1sj_GOCH=eQ$F?VlqK8Oi_ZXB$KdJe=d#Wzp$P!DGE-Fm literal 0 HcmV?d00001