From 99ed4dbfb45477a1bc6d32f1597023fdc74fed16 Mon Sep 17 00:00:00 2001 From: Taiizor Date: Wed, 24 Jun 2020 04:34:47 +0300 Subject: [PATCH] 53X Again 5! --- README.md | 2 +- Snake/Game.cs | 44 ++++++++++++++++--------------- Snake/Properties/AssemblyInfo.cs | 6 ++--- Snake/bin/Release/Snake.exe | Bin 217088 -> 217088 bytes Snake/bin/Release/Snake.pdb | Bin 28160 -> 28160 bytes 5 files changed, 27 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 726f638..792198a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Snake -

Snake v1.2

+

Snake v1.3

Visual Studio 2019

.NET Framework 4.8 (Minimum 4.0)

diff --git a/Snake/Game.cs b/Snake/Game.cs index e082df2..c901431 100644 --- a/Snake/Game.cs +++ b/Snake/Game.cs @@ -7,10 +7,10 @@ namespace Snake { public partial class Game : Form { - int VWidth, Width2, VHeight, Height2, X, Y, EX, EY, FX, FX2, FY, FY2; + int VWidth, Width2, VHeight, Height2, X, Y, AX, AY, FX, FX2, FY, FY2; Direction Direct; - int[] Locations1 = new int[9999999]; - int[] Locations2 = new int[9999999]; + int[] Locations1 = new int[999999]; + int[] Locations2 = new int[999999]; int Queue, Queue2/*, Queue3*/, T1, T2 = 0; int Measurement = 5; @@ -49,7 +49,7 @@ private enum Direction Up, Down, Left, Right } - private void Drawing(int EX, int EY) + private void Drawing(int AX, int AY) { Pen Pencil = new Pen(Color.Black, 5); Graphics Graph = null; @@ -59,8 +59,8 @@ private void Drawing(int EX, int EY) { Graph.DrawRectangle(Pencil, new Rectangle(Locations1[Queue2], Locations2[Queue2], 10, 10)); Graph.FillRectangle(Colored, Locations1[Queue2], Locations2[Queue2], 10, 10); - if (EX == Locations1[Queue2] && EY == Locations2[Queue2]) - AppleEat(EX, EY); + if (AX == Locations1[Queue2] && AY == Locations2[Queue2]) + AppleEat(AX, AY); Queue2++; } Pencil.Dispose(); @@ -72,7 +72,7 @@ private void Drawing(int EX, int EY) Queue2 = Queue; } - private void AppleEat(int EX, int EY) + private void AppleEat(int AX, int AY) { Apple = false; Measurement += Growth; @@ -80,8 +80,8 @@ private void AppleEat(int EX, int EY) Graphics Graph = null; Graph = CreateGraphics(); SolidBrush Colored = new SolidBrush(Color.White); - Graph.DrawRectangle(Pencil, new Rectangle(EX, EY, 10, 10)); - Graph.FillRectangle(Colored, EX, EY, 10, 10); + Graph.DrawRectangle(Pencil, new Rectangle(AX, AY, 10, 10)); + Graph.FillRectangle(Colored, AX, AY, 10, 10); Pencil.Dispose(); Graph.Dispose(); Colored.Dispose(); @@ -134,14 +134,14 @@ private void Gaming_Tick(object sender, EventArgs e) if (Apple == false) { Apple = true; - EX = Rastgele.Next(50, VWidth - 50); - EY = Rastgele.Next(50, VHeight - 50); + AX = Rastgele.Next(50, VWidth - 50); + AY = Rastgele.Next(50, VHeight - 50); Pen Pencil = new Pen(Color.Red, 5); Graphics Graph = null; Graph = CreateGraphics(); SolidBrush Colored = new SolidBrush(Color.Red); - Graph.DrawRectangle(Pencil, new Rectangle(EX, EY, 10, 10)); - Graph.FillRectangle(Colored, EX, EY, 10, 10); + Graph.DrawRectangle(Pencil, new Rectangle(AX, AY, 10, 10)); + Graph.FillRectangle(Colored, AX, AY, 10, 10); Pencil.Dispose(); Graph.Dispose(); Colored.Dispose(); @@ -152,8 +152,8 @@ private void Gaming_Tick(object sender, EventArgs e) Graphics Graph = null; Graph = CreateGraphics(); SolidBrush Colored = new SolidBrush(Color.Red); - Graph.DrawRectangle(Pencil, new Rectangle(EX, EY, 10, 10)); - Graph.FillRectangle(Colored, EX, EY, 10, 10); + Graph.DrawRectangle(Pencil, new Rectangle(AX, AY, 10, 10)); + Graph.FillRectangle(Colored, AX, AY, 10, 10); Pencil.Dispose(); Graph.Dispose(); } @@ -174,14 +174,14 @@ private void Gaming_Tick(object sender, EventArgs e) Locations1[Queue2] = 99999; Locations2[Queue2] = 99999; } - if (Width2 == EX && Height2 == EY) - AppleEat(EX, EY); + if (Width2 == AX && Height2 == AY) + AppleEat(AX, AY); else { - FX = Width2 - EX; - FY = Height2 - EY; + FX = Width2 - AX; + FY = Height2 - AY; if ((Math.Abs(FX) >= 0 && Math.Abs(FX) <= 8) && (Math.Abs(FY) >= 0 && Math.Abs(FY) <= 8)) - AppleEat(EX, EY); + AppleEat(AX, AY); } T2 += 50; if (T2 >= 1000) @@ -233,7 +233,9 @@ private void Game_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { e.IsInputKey = true; string Key = e.KeyCode.ToString(); - if (Continue) + if (Key == "Escape" || Key == "escape") + Application.Exit(); + else if (Continue) { if (Key == "Right" || Key == "right") { diff --git a/Snake/Properties/AssemblyInfo.cs b/Snake/Properties/AssemblyInfo.cs index 00abdee..17017b6 100644 --- a/Snake/Properties/AssemblyInfo.cs +++ b/Snake/Properties/AssemblyInfo.cs @@ -5,7 +5,7 @@ // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Snake")] -[assembly: AssemblyDescription("Snake v1.2")] +[assembly: AssemblyDescription("Snake v1.3")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Taiizor")] [assembly: AssemblyProduct("Snake")] @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2.0.0")] -[assembly: AssemblyFileVersion("1.2.0.0")] \ No newline at end of file +[assembly: AssemblyVersion("1.3.0.0")] +[assembly: AssemblyFileVersion("1.3.0.0")] \ No newline at end of file diff --git a/Snake/bin/Release/Snake.exe b/Snake/bin/Release/Snake.exe index 8b29aee0a99c524411992bad6b411543d98090fa..88fbf2a85ffcc2988457dc8bfed085924923a5bd 100644 GIT binary patch delta 3290 zcmZ`+4NP0t6+Y)a{A@qWk4bD}z}N{%c@S73sG}_D5<-BG|3H(#7Sg6ErD>ZyVzVSG z0sAeXr0eKvy{0JZx}~kMh%M>Xk_|DnYP(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