more shiftsweeper stuffs

This commit is contained in:
lempamo 2017-02-26 15:02:40 -05:00
parent 7ba86e65c4
commit c49c7ac9c6
15 changed files with 209 additions and 0 deletions

View file

@ -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)
{
}
}
}

View file

@ -1026,6 +1026,126 @@ namespace ShiftOS.WinForms.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap SweeperTile0 {
get {
object obj = ResourceManager.GetObject("SweeperTile0", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap SweeperTile1 {
get {
object obj = ResourceManager.GetObject("SweeperTile1", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap SweeperTile2 {
get {
object obj = ResourceManager.GetObject("SweeperTile2", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap SweeperTile3 {
get {
object obj = ResourceManager.GetObject("SweeperTile3", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap SweeperTile4 {
get {
object obj = ResourceManager.GetObject("SweeperTile4", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap SweeperTile5 {
get {
object obj = ResourceManager.GetObject("SweeperTile5", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap SweeperTile6 {
get {
object obj = ResourceManager.GetObject("SweeperTile6", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap SweeperTile7 {
get {
object obj = ResourceManager.GetObject("SweeperTile7", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap SweeperTile8 {
get {
object obj = ResourceManager.GetObject("SweeperTile8", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap SweeperTileBlock {
get {
object obj = ResourceManager.GetObject("SweeperTileBlock", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap SweeperTileBomb {
get {
object obj = ResourceManager.GetObject("SweeperTileBomb", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap SweeperTileFlag {
get {
object obj = ResourceManager.GetObject("SweeperTileFlag", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>

View file

@ -403,4 +403,40 @@
<data name="iconshutdown1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\SystemIcons\iconshutdown.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="SweeperTile0" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\SweeperTile0.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="SweeperTile1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\SweeperTile1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="SweeperTile2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\SweeperTile2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="SweeperTile3" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\SweeperTile3.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="SweeperTile4" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\SweeperTile4.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="SweeperTile5" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\SweeperTile5.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="SweeperTile6" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\SweeperTile6.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="SweeperTile7" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\SweeperTile7.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="SweeperTile8" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\SweeperTile8.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="SweeperTileBlock" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\SweeperTileBlock.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="SweeperTileBomb" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\SweeperTileBomb.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="SweeperTileFlag" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\SweeperTileFlag.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B