This commit is contained in:
maxwes08
2026-01-30 12:14:01 +01:00
parent b6e5c3dfbc
commit df6832419f
4 changed files with 82 additions and 6 deletions

View File

@@ -20,5 +20,20 @@ namespace Snake
_game.Update();
Invalidate();
}
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
switch (e.KeyCode)
{
case Keys.W:
_game.UpdateInput(Directions.Up); break;
case Keys.A:
_game.UpdateInput(Directions.Left); break;
case Keys.S:
_game.UpdateInput(Directions.Down); break;
case Keys.D:
_game.UpdateInput(Directions.Right); break;
}
}
}
}