public StateManager(Hero hero, World world) { LoadSounds(); this.world = world; platman = hero; rotationEffect = RotationEffect.GetRotationUp(0); platman.Mechanic.GravityManager.GravityChanged += GravityManager_GravityChanged; CurrentState = State.Standy; }
private void GravityManager_GravityChanged(object sender, EventArgs e) { if (world.Gravity == VelocityValues.Instance.GravityDown) { rotationEffect = RotationEffect.GetRotationDown(rotationEffect.Angle); } else if (world.Gravity == VelocityValues.Instance.GravityUp) { rotationEffect = RotationEffect.GetRotationUp(rotationEffect.Angle); } else if (world.Gravity == VelocityValues.Instance.GravityLeft) { rotationEffect = RotationEffect.GetRotationLeft(rotationEffect.Angle); } else if (world.Gravity == VelocityValues.Instance.GravityRight) { rotationEffect = RotationEffect.GetRotationRight(rotationEffect.Angle); } rotationEffect.Enabled = true; }