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

Commit

Permalink
53X Again 11!
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor committed Jul 19, 2020
1 parent 1c041dd commit 32a435d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 26 deletions.
51 changes: 25 additions & 26 deletions Snake/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,33 +94,32 @@ private void Gaming_Tick(object sender, EventArgs e)
X = Width2;
Y = Height2;

if (Direct == Direction.Right)
switch (Direct)
{
if (Width2 >= VWidth - 12)
Width2 = 2;
else
Width2 += 10;
}
else if (Direct == Direction.Left)
{
if (Width2 <= 1)
Width2 = VWidth - 13;
else
Width2 -= 10;
}
else if (Direct == Direction.Up)
{
if (Height2 <= 1)
Height2 = VHeight - 13;
else
Height2 -= 10;
}
else if (Direct == Direction.Down)
{
if (Height2 >= VHeight - 12)
Height2 = 2;
else
Height2 += 10;
case Direction.Up:
if (Height2 <= 1)
Height2 = VHeight - 13;
else
Height2 -= 10;
break;
case Direction.Down:
if (Height2 >= VHeight - 12)
Height2 = 2;
else
Height2 += 10;
break;
case Direction.Left:
if (Width2 <= 1)
Width2 = VWidth - 13;
else
Width2 -= 10;
break;
case Direction.Right:
if (Width2 >= VWidth - 12)
Width2 = 2;
else
Width2 += 10;
break;
}
Drawing(X, Y);
SnakeHead.Location = new Point(Width2, Height2);
Expand Down
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 32a435d

Please sign in to comment.