Skip to content
This repository has been archived by the owner on Jun 2, 2023. It is now read-only.

Commit

Permalink
53X Again 7!
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor committed Jun 24, 2020
1 parent 8d0d97b commit f8d7f87
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 45 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Snake
<p>Snake v1.3</p>
<p>Snake v1.4</p>
<p>Visual Studio 2019</p>
<p>.NET Framework 4.8 (Minimum 4.0)</p>
<img src="https://www.photo.herominyum.com/resimler/2020/06/24/dJm1.png" />
Expand Down
2 changes: 0 additions & 2 deletions Snake/Game.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 6 additions & 39 deletions Snake/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,39 +196,6 @@ private void Gaming_Tick(object sender, EventArgs e)
}
}

private void Game_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = true;
string Key = e.KeyChar.ToString();
if (Continue)
{
if (Key == "D" || Key == "d")
{
if (Direct != Direction.Left && Direct != Direction.Right)
Direct = Direction.Right;
}
else if (Key == "A" || Key == "a")
{
if (Direct != Direction.Right && Direct != Direction.Left)
Direct = Direction.Left;
}
else if (Key == "W" || Key == "w")
{
if (Direct != Direction.Down && Direct != Direction.Up)
Direct = Direction.Up;
}
else if (Key == "S" || Key == "s")
{
if (Direct != Direction.Up && Direct != Direction.Down)
Direct = Direction.Down;
}
else if (Key == "P" || Key == "p")
Continue = !Continue;
}
else if (Key == "P" || Key == "p")
Continue = !Continue;
}

private void Game_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
e.IsInputKey = true;
Expand All @@ -237,30 +204,30 @@ private void Game_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
Application.Exit();
else if (Continue)
{
if (Key == "Right" || Key == "right")
if (Key == "Right" || Key == "right" || Key == "D" || Key == "d")
{
if (Direct != Direction.Left && Direct != Direction.Right)
Direct = Direction.Right;
}
else if (Key == "Left" || Key == "left")
else if (Key == "Left" || Key == "left" || Key == "A" || Key == "a")
{
if (Direct != Direction.Right && Direct != Direction.Left)
Direct = Direction.Left;
}
else if (Key == "Up" || Key == "up")
else if (Key == "Up" || Key == "up" || Key == "W" || Key == "w")
{
if (Direct != Direction.Down && Direct != Direction.Up)
Direct = Direction.Up;
}
else if (Key == "Down" || Key == "down")
else if (Key == "Down" || Key == "down" || Key == "S" || Key == "s")
{
if (Direct != Direction.Up && Direct != Direction.Down)
Direct = Direction.Down;
}
else if (Key == "Pause" || Key == "pause")
else if (Key == "Pause" || Key == "pause" || Key == "P" || Key == "p")
Continue = !Continue;
}
else if (Key == "Pause" || Key == "pause")
else if (Key == "Pause" || Key == "pause" || Key == "P" || Key == "p")
Continue = !Continue;
}

Expand Down
6 changes: 3 additions & 3 deletions Snake/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.3")]
[assembly: AssemblyDescription("Snake v1.4")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Taiizor")]
[assembly: AssemblyProduct("Snake")]
Expand All @@ -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.3.0.0")]
[assembly: AssemblyFileVersion("1.3.0.0")]
[assembly: AssemblyVersion("1.4.0.0")]
[assembly: AssemblyFileVersion("1.4.0.0")]
Binary file modified Snake/bin/Release/Snake.exe
Binary file not shown.
Binary file modified Snake/bin/Release/Snake.pdb
Binary file not shown.

0 comments on commit f8d7f87

Please sign in to comment.