/// <summary> /// Tracks location of the mouse /// </summary> private void TankWars_MouseMove(object sender, MouseEventArgs e) { if (TheController.wallsDone) { TheController.ProcessMouseMove(e.X, e.Y); } }
/// <summary> /// Triggers processing of a mouse movement. /// </summary> private void GamePanel_MouseMove(object sender, MouseEventArgs e) { // should be the cursor position (normalized) relative to the center of the image, since your tank is always in the center of the image. gameController.ProcessMouseMove(e.X - 400, e.Y - 400); // This needs to be changed, should make sure tank really is the center of the image }