public Form1() { InitializeComponent(); _x = 50; _y = 50; _objsijainti = sijainti.down; }
private void Form1_KeyPress(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Left) { _objsijainti = sijainti.left; } else if (e.KeyCode == Keys.Right) { _objsijainti = sijainti.right; } else if (e.KeyCode == Keys.Up) { _objsijainti = sijainti.up; } else if (e.KeyCode == Keys.Down) { _objsijainti = sijainti.down; } }