setting up minefield
This commit is contained in:
parent
ca703e314d
commit
4fba2d86af
4 changed files with 98 additions and 26 deletions
|
@ -29,10 +29,11 @@
|
|||
private void InitializeComponent()
|
||||
{
|
||||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.minefieldPanel = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.buttonE = new System.Windows.Forms.Button();
|
||||
this.buttonM = new System.Windows.Forms.Button();
|
||||
this.buttonH = new System.Windows.Forms.Button();
|
||||
this.lblmines = new System.Windows.Forms.Label();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
|
@ -40,24 +41,38 @@
|
|||
//
|
||||
this.pictureBox1.BackgroundImage = global::ShiftOS.WinForms.Properties.Resources.SweeperNormalFace;
|
||||
this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
|
||||
this.pictureBox1.Location = new System.Drawing.Point(110, 3);
|
||||
this.pictureBox1.Location = new System.Drawing.Point(150, 3);
|
||||
this.pictureBox1.Name = "pictureBox1";
|
||||
this.pictureBox1.Size = new System.Drawing.Size(32, 32);
|
||||
this.pictureBox1.TabIndex = 0;
|
||||
this.pictureBox1.TabStop = false;
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
// minefieldPanel
|
||||
//
|
||||
this.tableLayoutPanel1.ColumnCount = 2;
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.tableLayoutPanel1.Location = new System.Drawing.Point(4, 39);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
this.tableLayoutPanel1.RowCount = 2;
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(244, 215);
|
||||
this.tableLayoutPanel1.TabIndex = 1;
|
||||
this.minefieldPanel.ColumnCount = 9;
|
||||
this.minefieldPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
|
||||
this.minefieldPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
|
||||
this.minefieldPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
|
||||
this.minefieldPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
|
||||
this.minefieldPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
|
||||
this.minefieldPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
|
||||
this.minefieldPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
|
||||
this.minefieldPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
|
||||
this.minefieldPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
|
||||
this.minefieldPanel.Location = new System.Drawing.Point(4, 40);
|
||||
this.minefieldPanel.Name = "minefieldPanel";
|
||||
this.minefieldPanel.RowCount = 9;
|
||||
this.minefieldPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
|
||||
this.minefieldPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
|
||||
this.minefieldPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
|
||||
this.minefieldPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
|
||||
this.minefieldPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
|
||||
this.minefieldPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
|
||||
this.minefieldPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
|
||||
this.minefieldPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
|
||||
this.minefieldPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.11111F));
|
||||
this.minefieldPanel.Size = new System.Drawing.Size(329, 215);
|
||||
this.minefieldPanel.TabIndex = 1;
|
||||
//
|
||||
// buttonE
|
||||
//
|
||||
|
@ -67,10 +82,11 @@
|
|||
this.buttonE.TabIndex = 2;
|
||||
this.buttonE.Text = "Easy";
|
||||
this.buttonE.UseVisualStyleBackColor = true;
|
||||
this.buttonE.Click += new System.EventHandler(this.buttonE_Click);
|
||||
//
|
||||
// buttonM
|
||||
//
|
||||
this.buttonM.Location = new System.Drawing.Point(86, 261);
|
||||
this.buttonM.Location = new System.Drawing.Point(129, 261);
|
||||
this.buttonM.Name = "buttonM";
|
||||
this.buttonM.Size = new System.Drawing.Size(75, 23);
|
||||
this.buttonM.TabIndex = 3;
|
||||
|
@ -79,35 +95,47 @@
|
|||
//
|
||||
// buttonH
|
||||
//
|
||||
this.buttonH.Location = new System.Drawing.Point(168, 261);
|
||||
this.buttonH.Location = new System.Drawing.Point(258, 261);
|
||||
this.buttonH.Name = "buttonH";
|
||||
this.buttonH.Size = new System.Drawing.Size(75, 23);
|
||||
this.buttonH.TabIndex = 4;
|
||||
this.buttonH.Text = "Hard";
|
||||
this.buttonH.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// lblmines
|
||||
//
|
||||
this.lblmines.AutoSize = true;
|
||||
this.lblmines.Location = new System.Drawing.Point(188, 3);
|
||||
this.lblmines.Name = "lblmines";
|
||||
this.lblmines.Size = new System.Drawing.Size(47, 13);
|
||||
this.lblmines.TabIndex = 5;
|
||||
this.lblmines.Text = "Mines: 0";
|
||||
//
|
||||
// ShiftSweeper
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.lblmines);
|
||||
this.Controls.Add(this.buttonH);
|
||||
this.Controls.Add(this.buttonM);
|
||||
this.Controls.Add(this.buttonE);
|
||||
this.Controls.Add(this.tableLayoutPanel1);
|
||||
this.Controls.Add(this.minefieldPanel);
|
||||
this.Controls.Add(this.pictureBox1);
|
||||
this.Name = "ShiftSweeper";
|
||||
this.Size = new System.Drawing.Size(275, 333);
|
||||
this.Size = new System.Drawing.Size(366, 328);
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
|
||||
private System.Windows.Forms.TableLayoutPanel minefieldPanel;
|
||||
private System.Windows.Forms.Button buttonE;
|
||||
private System.Windows.Forms.Button buttonM;
|
||||
private System.Windows.Forms.Button buttonH;
|
||||
private System.Windows.Forms.Label lblmines;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,13 +11,14 @@ using ShiftOS.Engine;
|
|||
|
||||
namespace ShiftOS.WinForms.Applications
|
||||
{
|
||||
[Launcher("ShiftSweeper", false, null, "Games")]
|
||||
[Launcher("ShiftSweeper", true, "shiftsweeper", "Games")]
|
||||
[RequiresUpgrade("shiftsweeper")]
|
||||
[WinOpen("shiftsweeper")]
|
||||
[DefaultIcon("iconShiftSweeper")]
|
||||
public partial class ShiftSweeper : UserControl, IShiftOSWindow
|
||||
{
|
||||
private bool gameplayed = false;
|
||||
private int mineCount = 0;
|
||||
|
||||
public ShiftSweeper()
|
||||
{
|
||||
|
@ -26,7 +27,9 @@ namespace ShiftOS.WinForms.Applications
|
|||
|
||||
public void OnLoad()
|
||||
{
|
||||
|
||||
buttonE.Visible = true;
|
||||
buttonM.Visible = ShiftoriumFrontend.UpgradeInstalled("shiftsweeper_medium");
|
||||
buttonH.Visible = ShiftoriumFrontend.UpgradeInstalled("shiftsweeper_hard");
|
||||
}
|
||||
|
||||
public void OnSkinLoad() { }
|
||||
|
@ -37,5 +40,25 @@ namespace ShiftOS.WinForms.Applications
|
|||
{
|
||||
|
||||
}
|
||||
|
||||
private void buttonE_Click(object sender, EventArgs e)
|
||||
{
|
||||
startGame(0);
|
||||
}
|
||||
|
||||
private void startGame(int d)
|
||||
{
|
||||
switch (d)
|
||||
{
|
||||
case 0:
|
||||
mineCount = 10;
|
||||
minefieldPanel.ColumnCount = 9;
|
||||
minefieldPanel.RowCount = 9;
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -794,4 +794,10 @@
|
|||
Dependencies: "shiftsweeper",
|
||||
Description: "ShiftSweeper getting too easy? Obviously, since you can only play Easy difficulty! However, with this Medium button, you can get a better challenge, and more codepoints!"
|
||||
},
|
||||
{
|
||||
Name: "ShiftSweeper Hard",
|
||||
Cost: 900,
|
||||
Dependencies: "shiftsweeper_medium",
|
||||
Description: "Is ShiftSweeper still too easy for you? Buy the Hard difficulty and you can try to find 99 mines! It may be extremely difficult, but the reward is massive!"
|
||||
},
|
||||
]
|
|
@ -178,6 +178,12 @@
|
|||
<Compile Include="Applications\ShiftoriumFrontend.Designer.cs">
|
||||
<DependentUpon>ShiftoriumFrontend.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Applications\ShiftSweeper.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Applications\ShiftSweeper.Designer.cs">
|
||||
<DependentUpon>ShiftSweeper.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Applications\ShopItemCreator.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
|
@ -239,6 +245,11 @@
|
|||
<Compile Include="Oobe.Designer.cs">
|
||||
<DependentUpon>Oobe.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ShiftOSAudioProvider.cs" />
|
||||
<Compile Include="ShiftOSConfigFile.cs" />
|
||||
<Compile Include="Tools\ColorPickerDataBackend.cs" />
|
||||
|
@ -322,6 +333,9 @@
|
|||
<EmbeddedResource Include="Applications\ShiftoriumFrontend.resx">
|
||||
<DependentUpon>ShiftoriumFrontend.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Applications\ShiftSweeper.resx">
|
||||
<DependentUpon>ShiftSweeper.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Applications\ShopItemCreator.resx">
|
||||
<DependentUpon>ShopItemCreator.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
@ -345,14 +359,9 @@
|
|||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="WindowBorder.resx">
|
||||
<DependentUpon>WindowBorder.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
@ -528,6 +537,10 @@
|
|||
<ItemGroup>
|
||||
<None Include="Resources\RegularDesktopGlyph.bmp" />
|
||||
<None Include="Resources\justthes.png" />
|
||||
<None Include="Resources\SweeperClickFace.png" />
|
||||
<None Include="Resources\SweeperLoseFace.png" />
|
||||
<None Include="Resources\SweeperNormalFace.png" />
|
||||
<None Include="Resources\SweeperWinFace.png" />
|
||||
<Content Include="SystemIcons\iconArtpad.png" />
|
||||
<Content Include="SystemIcons\iconAudioPlayer.png" />
|
||||
<Content Include="SystemIcons\iconBitnoteDigger.png" />
|
||||
|
@ -551,8 +564,10 @@
|
|||
<Content Include="SystemIcons\iconorcwrite.png" />
|
||||
<Content Include="SystemIcons\iconPong.png" />
|
||||
<Content Include="SystemIcons\iconShifter.png" />
|
||||
<None Include="SystemIcons\iconShiftLetters.png" />
|
||||
<Content Include="SystemIcons\iconShiftnet.png" />
|
||||
<Content Include="SystemIcons\iconShiftorium.png" />
|
||||
<None Include="SystemIcons\iconShiftSweeper.png" />
|
||||
<Content Include="SystemIcons\iconshutdown.png" />
|
||||
<Content Include="SystemIcons\iconSkinLoader.png" />
|
||||
<Content Include="SystemIcons\iconSkinShifter.png" />
|
||||
|
|
Reference in a new issue