public void Fire_Missile_Click(object sender, RoutedEventArgs e) { var sele = (UIElement)LogicalTreeHelper.FindLogicalNode(Enemy_Canvas, "selection"); Enemy_Canvas.Children.Remove(sele); ///Clean this if statement up and convert to a switch statement //Create a rectangle that is dependant on if a hit or miss is achieved if (gameBoard.PerformTurn() == false) { if (gameBoard.playerOne.active == true) { PlaceHitOrMiss(Enemy_Canvas, false); Miss_Ratio.Content = "Miss: " + gameBoard.playerOne.playerGrid.misses; } else { PlaceHitOrMiss(Player_Canvas, false); Miss_Ratio.Content = "Miss: " + gameBoard.playerTwo.playerGrid.misses; } } else { Rectangle hit = CreateRectangle(true); Enemy_Canvas.Children.Add(hit); PlaceRectangle(hit); Fire_Missile.IsEnabled = false; Hit_Ratio.Content = "Hit: " + gameBoard.playerOne.playerGrid.hits; } }