/// <summary> /// Method that is called when a pea finishes jumping /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void _source_OnJumpCompleted(JumpEventArgs e) { if (_activeState != null) { _activeState.Exit(); } if (!e.Pea.IsAlive) { return; } if (e.Pea.IsTrapped) { _alert = SpriteAlert.GenerateTrap(this.SceneLayer); } else if (!e.Pea.IsNotHappy) { _alert = SpriteAlert.GenerateNinja(this.SceneLayer); } if (_alert != null) { _alert.Initialize(); if (this.ContentManager != null) { _alert.LoadContent(this.ContentManager); } } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void _source_OnJumpSpotCompleted(object sender, EventArgs e) { var spot = sender as DataJumpSpot; _jumpSpotAlert = SpriteAlert.GenerateCompleted(this.SceneLayer); _jumpSpotAlert.Initialize(); _jumpSpotAlert.LoadContent(this.ContentManager); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void _source_OnJumpSpotMarked(object sender, EventArgs e) { var spot = sender as DataJumpSpot; if (_jumpSpotAlert == null) { _jumpSpotAlert = SpriteAlert.GenerateJumpSpot(this.SceneLayer); _jumpSpotAlert.Initialize(); _jumpSpotAlert.LoadContent(this.ContentManager); _jumpSpotAlert.OnFinished += new EventHandler(_jumpSpotAlert_OnFinished); } }