public void ChangeValue() { if (buttonState == ButtonState.Selected && (Globals.GetKeyDown(Keys.A) || (Globals.GetKeyDown(Keys.Left)))) { // Decrease the selected amount. Selected--; // If the amount goes below 0, reset it to 0. if (Selected < 0) { Selected = 0; } } if (buttonState == ButtonState.Selected && (Globals.GetKeyDown(Keys.D) || (Globals.GetKeyDown(Keys.Right)))) { // Increase the selected amount. Selected++; // If the amount is increased further than the max, reset it to the max amount. if (Selected > SelectedMax) { Selected = SelectedMax; } } }