public void Update(GameTime gameTime, ref GameStates gameState, ref Level level)
{
/* If the user hits up */
if (_mControls.IsUpPressed(false))
{
/* If we are not on the first element already */
if (_mCurrent > 0)
{
GameSound.MenuSoundRollover.Play(GameSound.Volume, 0.0f, 0.0f);
/* Decrement current and change the images */
_mCurrent--;
for (var i = 0; i < NumOptions; i++)
_mItems[i] = _mUnselItems[i];
_mItems[_mCurrent] = _mSelItems[_mCurrent];
}
}
/* If the user hits the down button */
if (_mControls.IsDownPressed(false))
{
/* If we are on the last element in the menu */
if (_mCurrent < NumOptions - 1)
{
GameSound.MenuSoundRollover.Play(GameSound.Volume, 0.0f, 0.0f);
/* Increment current and update graphics */
_mCurrent++;
for (var i = 0; i < NumOptions; i++)
_mItems[i] = _mUnselItems[i];
_mItems[_mCurrent] = _mSelItems[_mCurrent];
}
}
/* If the user selects a menu item */
if (_mControls.IsAPressed(false) || _mControls.IsStartPressed(false))
{
GameSound.MenuSoundSelect.Play(GameSound.Volume, 0.0f, 0.0f);
/* Continue */
if (_mCurrent == 0)
{
gameState = GameStates.NewLevelSelection;
level.Reset();
_mCurrent = 1;
for (var i = 0; i < NumOptions; i++)
_mItems[i] = _mUnselItems[i];
_mItems[_mCurrent] = _mSelItems[_mCurrent];
}
/* Back */
else if (_mCurrent == 1)
{
gameState = GameStates.Options;
}
}
if (_mControls.IsBPressed(false) || _mControls.IsBackPressed(false))
gameState = GameStates.Options;
}