public override void Update()
{
mouse = new Point(Mouse.GetState().X, Mouse.GetState().Y);
if ((Frameinfo.PreviousMouseState.LeftButton == ButtonState.Pressed) &&
(Frameinfo.MouseState.LeftButton == ButtonState.Released))
if (button1.Contains(mouse))
{
if (CurrentGameStateIndex == 1)
CannonGame.ChangeState(4);
else if (CurrentGameStateIndex == 5)
CannonGame.ChangeState(CannonGame.PreviousLevel);
else if (CurrentGameStateIndex == 6)
CannonGame.ChangeState(CannonGame.PreviousLevel);
}
else if (button2.Contains(mouse))
{
if (CurrentGameStateIndex == 1)
CannonGame.ChangeState(2);
else if (CurrentGameStateIndex == 5)
CannonGame.ChangeState(CannonGame.PreviousLevel + 1);
else if (CurrentGameStateIndex == 6)
CannonGame.ChangeState(4);
}
else if (button3.Contains(mouse))
{
if (CurrentGameStateIndex == 1)
CannonGame.ChangeState(3);
else if (CurrentGameStateIndex == 5)
CannonGame.ChangeState(4);
else if (CurrentGameStateIndex == 6)
CannonGame.ChangeState(1);
}
else if (button4.Contains(mouse))
{
if (CurrentGameStateIndex == 1)
CannonGame.ExitGame = true;
else if (CurrentGameStateIndex == 5)
CannonGame.ChangeState(1);
else if (CurrentGameStateIndex == 6)
CannonGame.ExitGame = true;
}
}