// Stick mover private void Stick_KeyDown(object sender, KeyEventArgs e) { if (!isPaused) { if (e.KeyCode == Keys.Left) { Stick.Left = Stick.Location.X - 20; // if left key is pressed, move the stick left } else if (e.KeyCode == Keys.Right) { Stick.Left = Stick.Location.X + 20; // if right key is pressed, move the stick right } } if (isPaused && GodMode) { GodModeLabel.Show(); if (e.KeyCode == Keys.Left) { Stick.Left = Stick.Location.X - 20; // if left key is pressed, move the stick left } else if (e.KeyCode == Keys.Right) { Stick.Left = Stick.Location.X + 20; // if right key is pressed, move the stick right } } }
private void Form1_KeyDown(object sender, KeyEventArgs e) { // God Mode if (e.KeyCode == Keys.G) { if (GodMode == false) { GodMode = true; } else { GodMode = false; GodModeLabel.Hide(); } } // Escape if (e.KeyCode == Keys.Escape) { Close(); } // Pause if (e.KeyCode == Keys.Space) { if (isPaused == false) { isPaused = true; // Pause: ON PausedLabel.Show(); Time.Stop(); } else { isPaused = false; // Pause: OFF PausedLabel.Hide(); Time.Start(); } } }
void HideLabels() { GodModeLabel.Hide(); Cursor.Hide(); PausedLabel.Hide(); }