diff --git a/Snake/Game.Designer.cs b/Snake/Game.Designer.cs index 55163c8..9b01028 100644 --- a/Snake/Game.Designer.cs +++ b/Snake/Game.Designer.cs @@ -31,11 +31,11 @@ private void InitializeComponent() this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Game)); this.shapeContainer1 = new Microsoft.VisualBasic.PowerPacks.ShapeContainer(); - this.rectangleShape2 = new Microsoft.VisualBasic.PowerPacks.RectangleShape(); + this.SnakeHead = new Microsoft.VisualBasic.PowerPacks.RectangleShape(); this.Gaming = new System.Windows.Forms.Timer(this.components); - this.label1 = new System.Windows.Forms.Label(); + this.InfoLabel = new System.Windows.Forms.Label(); this.Death = new System.Windows.Forms.Timer(this.components); - this.label2 = new System.Windows.Forms.Label(); + this.StateLabel = new System.Windows.Forms.Label(); this.SuspendLayout(); // // shapeContainer1 @@ -44,25 +44,25 @@ private void InitializeComponent() this.shapeContainer1.Margin = new System.Windows.Forms.Padding(0); this.shapeContainer1.Name = "shapeContainer1"; this.shapeContainer1.Shapes.AddRange(new Microsoft.VisualBasic.PowerPacks.Shape[] { - this.rectangleShape2}); + this.SnakeHead}); this.shapeContainer1.Size = new System.Drawing.Size(284, 261); this.shapeContainer1.TabIndex = 0; this.shapeContainer1.TabStop = false; // - // rectangleShape2 + // SnakeHead // - this.rectangleShape2.Anchor = System.Windows.Forms.AnchorStyles.None; - this.rectangleShape2.BackColor = System.Drawing.Color.Black; - this.rectangleShape2.BorderWidth = 5; - this.rectangleShape2.Cursor = System.Windows.Forms.Cursors.Default; - this.rectangleShape2.Enabled = false; - this.rectangleShape2.FillColor = System.Drawing.Color.Black; - this.rectangleShape2.FillGradientColor = System.Drawing.Color.Black; - this.rectangleShape2.FillGradientStyle = Microsoft.VisualBasic.PowerPacks.FillGradientStyle.Central; - this.rectangleShape2.Location = new System.Drawing.Point(134, 118); - this.rectangleShape2.Name = "rectangleShape2"; - this.rectangleShape2.SelectionColor = System.Drawing.Color.Black; - this.rectangleShape2.Size = new System.Drawing.Size(10, 10); + this.SnakeHead.Anchor = System.Windows.Forms.AnchorStyles.None; + this.SnakeHead.BackColor = System.Drawing.Color.Black; + this.SnakeHead.BorderWidth = 5; + this.SnakeHead.Cursor = System.Windows.Forms.Cursors.Default; + this.SnakeHead.Enabled = false; + this.SnakeHead.FillColor = System.Drawing.Color.Black; + this.SnakeHead.FillGradientColor = System.Drawing.Color.Black; + this.SnakeHead.FillGradientStyle = Microsoft.VisualBasic.PowerPacks.FillGradientStyle.Central; + this.SnakeHead.Location = new System.Drawing.Point(134, 118); + this.SnakeHead.Name = "SnakeHead"; + this.SnakeHead.SelectionColor = System.Drawing.Color.Black; + this.SnakeHead.Size = new System.Drawing.Size(10, 10); // // Gaming // @@ -70,18 +70,18 @@ private void InitializeComponent() this.Gaming.Interval = 50; this.Gaming.Tick += new System.EventHandler(this.Gaming_Tick); // - // label1 + // InfoLabel // - this.label1.AutoSize = true; - this.label1.BackColor = System.Drawing.Color.Transparent; - this.label1.Enabled = false; - this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 16.5F); - this.label1.Location = new System.Drawing.Point(9, 9); - this.label1.Margin = new System.Windows.Forms.Padding(0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(70, 26); - this.label1.TabIndex = 1; - this.label1.Text = "label1"; + this.InfoLabel.AutoSize = true; + this.InfoLabel.BackColor = System.Drawing.Color.Transparent; + this.InfoLabel.Enabled = false; + this.InfoLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 16.5F); + this.InfoLabel.Location = new System.Drawing.Point(9, 9); + this.InfoLabel.Margin = new System.Windows.Forms.Padding(0); + this.InfoLabel.Name = "InfoLabel"; + this.InfoLabel.Size = new System.Drawing.Size(70, 26); + this.InfoLabel.TabIndex = 1; + this.InfoLabel.Text = "InfoLabel"; // // Death // @@ -89,19 +89,19 @@ private void InitializeComponent() this.Death.Interval = 50; this.Death.Tick += new System.EventHandler(this.Death_Tick); // - // label2 + // StateLabel // - this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.label2.AutoSize = true; - this.label2.BackColor = System.Drawing.Color.Transparent; - this.label2.Enabled = false; - this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 16.5F); - this.label2.Location = new System.Drawing.Point(9, 200); - this.label2.Margin = new System.Windows.Forms.Padding(0); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(70, 26); - this.label2.TabIndex = 2; - this.label2.Text = "label2"; + this.StateLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.StateLabel.AutoSize = true; + this.StateLabel.BackColor = System.Drawing.Color.Transparent; + this.StateLabel.Enabled = false; + this.StateLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 16.5F); + this.StateLabel.Location = new System.Drawing.Point(9, 200); + this.StateLabel.Margin = new System.Windows.Forms.Padding(0); + this.StateLabel.Name = "StateLabel"; + this.StateLabel.Size = new System.Drawing.Size(70, 26); + this.StateLabel.TabIndex = 2; + this.StateLabel.Text = "StateLabel"; // // Game // @@ -110,8 +110,8 @@ private void InitializeComponent() this.BackColor = System.Drawing.Color.White; this.ClientSize = new System.Drawing.Size(284, 261); this.ControlBox = false; - this.Controls.Add(this.label2); - this.Controls.Add(this.label1); + this.Controls.Add(this.StateLabel); + this.Controls.Add(this.InfoLabel); this.Controls.Add(this.shapeContainer1); this.DoubleBuffered = true; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; @@ -131,10 +131,10 @@ private void InitializeComponent() #endregion private Microsoft.VisualBasic.PowerPacks.ShapeContainer shapeContainer1; - private Microsoft.VisualBasic.PowerPacks.RectangleShape rectangleShape2; + private Microsoft.VisualBasic.PowerPacks.RectangleShape SnakeHead; private System.Windows.Forms.Timer Gaming; - private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label InfoLabel; private System.Windows.Forms.Timer Death; - private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label StateLabel; } } \ No newline at end of file diff --git a/Snake/Game.cs b/Snake/Game.cs index 2fff7bb..3aff028 100644 --- a/Snake/Game.cs +++ b/Snake/Game.cs @@ -41,7 +41,7 @@ private void Game_Load(object sender, EventArgs e) Direct = Direction.Right; Width = VWidth; Height = VHeight; - rectangleShape2.Location = new Point(Width2, Height2); + SnakeHead.Location = new Point(Width2, Height2); } private enum Direction @@ -123,7 +123,7 @@ private void Gaming_Tick(object sender, EventArgs e) Height2 += 10; } Drawing(X, Y); - rectangleShape2.Location = new Point(Width2, Height2); + SnakeHead.Location = new Point(Width2, Height2); if (X != Width2 || Y != Height2) { @@ -189,10 +189,11 @@ private void Gaming_Tick(object sender, EventArgs e) T1++; T2 = 0; } - label1.Text = "X = " + Width2 + " - FX = " + Math.Abs(FX) + "\n" + "Y = " + Height2 + " - FY = " + Math.Abs(FY); - label2.Text = "Measurement = " + Measurement + "\n" + "Time = " + T1 + "." + T2 + " Second"; - label1.SendToBack(); - label2.SendToBack(); + InfoLabel.Text = "X = " + Width2 + " - FX = " + Math.Abs(FX) + "\n" + "Y = " + Height2 + " - FY = " + Math.Abs(FY); + StateLabel.Text = "Measurement = " + Measurement + "\n" + "Time = " + T1 + "." + T2 + " Second"; + InfoLabel.SendToBack(); + StateLabel.SendToBack(); + SnakeHead.BringToFront(); } } diff --git a/Snake/bin/Release/Snake.exe b/Snake/bin/Release/Snake.exe index 5c7242e..eff6143 100644 Binary files a/Snake/bin/Release/Snake.exe and b/Snake/bin/Release/Snake.exe differ diff --git a/Snake/bin/Release/Snake.pdb b/Snake/bin/Release/Snake.pdb index 8bda59a..d7c9a24 100644 Binary files a/Snake/bin/Release/Snake.pdb and b/Snake/bin/Release/Snake.pdb differ