public HeroCelebrateState(HeroStateMachine HSM) : base(HSM) { hero.sprite.LoadAnimation(hero.CelebrateAnimation); hero.InvincibilityFrames = 0; hero.Movement = 0; hero.Velocity = new Vector2(0, hero.Velocity.Y); }
public HeroRunningState(HeroStateMachine HSM) : base(HSM) { hero.sprite.LoadAnimation(hero.RunAnimation); //only do the run animation if velocity is above a threshold //to eliminate errors from sensitive keyboards or something //if (Math.Abs(hero.Velocity.X) - 0.02f > 0) //{ // hero.Sprite.LoadAnimation(hero.RunAnimation); //} //else // hero.Sprite.LoadAnimation(hero.IdleAnimation); }
public void Swap(HeroStateMachine otherHSM) { if (otherHSM.Character.IsAlive) { MainState = (State)Activator.CreateInstance(otherHSM.MainState.GetType(), this); ShooterState = (State)Activator.CreateInstance(otherHSM.ShooterState.GetType(), this); ShieldState = (State)Activator.CreateInstance(otherHSM.ShieldState.GetType(), this); } else { Reset(); } }
public NotBlockingState(HeroStateMachine HSM) : base(HSM) { System.Diagnostics.Debug.WriteLine("NotBlockingState"); }
public ShieldState(HeroStateMachine HSM) : base(HSM) { hsm = HSM; hero = (Hero)HSM.Character; }
public ShieldHitState(HeroStateMachine HSM) : base(HSM) { hero.ShieldHitTime = hero.MaxShieldHitTime; System.Diagnostics.Debug.WriteLine("ShieldHitState"); }
public HeroShooterState(HeroStateMachine HSM) : base(HSM) { this.hsm = (HeroStateMachine)sm; hero = (Hero)character; }
public HeroJumpingState(HeroStateMachine HSM) : base(HSM) { hero.sprite.LoadAnimation(hero.JumpAnimation); character.JumpSound.Play(); }
protected virtual void LoadContent() { stateMachine = new HeroStateMachine(this); }
public HeroReloadingState(HeroStateMachine HSM) : base(HSM) { System.Diagnostics.Debug.WriteLine("ReloadingState"); }
public HeroIdleState(HeroStateMachine HSM) : base(HSM) { hero.sprite.LoadAnimation(hero.IdleAnimation); }
public HeroMainState(HeroStateMachine hsm) : base(hsm) { this.hsm = (HeroStateMachine)sm; hero = (Hero)character; }
public HeroSwitchWeaponState(HeroStateMachine HSM) : base(HSM) { System.Diagnostics.Debug.WriteLine("SwitchWeaponState"); }
public DepletedState(HeroStateMachine HSM) : base(HSM) { hero.DepletedShieldTime = hero.MaxDepletedShieldTime; System.Diagnostics.Debug.WriteLine("DepletedState"); }