private IEnumerator YellowBoostCoroutine() { Player player = StateGetPlayer(); YellowBooster booster = null; foreach (YellowBooster b in player.Scene.Tracker.GetEntities <YellowBooster>()) { if (b.StartedBoosting) { booster = b; break; } } yield return(booster.BoostTime / 6); // was 0.25 booster.sprite.SetColor(booster.FlashTint); yield return(booster.BoostTime / 3); booster.sprite.SetColor(Color.White); yield return(booster.BoostTime / 6); booster.sprite.SetColor(booster.FlashTint); yield return(booster.BoostTime / 3); booster.sprite.SetColor(Color.White); // Player didn't dash out, time to kill them :( player.Die(player.DashDir); booster.PlayerDied(); //player.StateMachine.State = Player.StDash; yield break; }
public static void Boost(Player player, YellowBooster booster) { player.StateMachine.State = FrostModule.YellowBoostState; player.Speed = Vector2.Zero; //player.boostTarget = booster.Center; //player.boostRed = false; FrostModule.player_boostTarget.SetValue(player, booster.Center); booster.StartedBoosting = true; //player.CurrentBooster = booster; //this.LastBooster = booster; }