Example #1
0
        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;
        }
Example #2
0
        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;
        }