public override void Update()
{
MouseState mouse_state = Mouse.GetState(); // Gets the mouse state object
Point mouse_position = new Point(mouse_state.X, mouse_state.Y); // creates a point for the mouse's position
if (isContinueButtonClicked)
{
if (mouse_state.LeftButton == ButtonState.Released)
{
if (mPlayer1Tutorial.SpawnTutorial == true)
{
mPlayer1Tutorial.SpawnTutorial = false;
TutorialMapSpawnGameState new_state = new TutorialMapSpawnGameState(display_map_state);
_mediator_manager.Notify("haxxit.engine.state.change", this, new ChangeStateEventArgs(new_state));
}
else if (mPlayer1Tutorial.level2Tutorial == true)
{
mPlayer1Tutorial.level2Tutorial = false;
TutorialMapSpawnGameState new_state = new TutorialMapSpawnGameState(display_map_state);
_mediator_manager.Notify("haxxit.engine.state.change", this, new ChangeStateEventArgs(new_state));
}
else
{
MapPlayGameState new_state = new MapPlayGameState(display_map_state);
_mediator_manager.Notify("haxxit.engine.state.change", this, new ChangeStateEventArgs(new_state));
}
}
}
//Update for Continue Button
if (ContinueButtonRect.Contains(mouse_position) && mouse_state.LeftButton == ButtonState.Pressed)
{
isContinueButtonClicked = true;
}
// if hovering over rectangle
else if (ContinueButtonRect.Contains(mouse_position))
{
}
else // neither clicking nor hovering over rectangle
{
isContinueButtonClicked = false;
}
}