public Update ( |
||
gameTime | Provides a snapshot of timing values. | |
return | void |
public override void Update(GameTime gameTime)
{
// TODO: Add your update code here
keyboardState = Keyboard.GetState();
if (CheckKey(Keys.Down))
{
selectedIndex++;
if (selectedIndex == menuItems.Length)
selectedIndex = 0;
}
if (CheckKey(Keys.Up))
{
selectedIndex--;
if (selectedIndex < 0)
selectedIndex = menuItems.Length - 1;
}
base.Update(gameTime);
oldKeyboardState = keyboardState;
}