Пример #1
0
        public override void Update(GameTime t, Dictionary <String, Actor> .ValueCollection targets)
        {
            UpdateFrame(t);
            switch (frame)
            {
            case 0: Actor.ImageXindex = 3;  break;

            case 3: Actor.ImageXindex = 4;  break;

            case 6: Actor.ImageXindex = 5; break;

            case 9: Actor.ImageXindex = 6; break;

            case 12: Actor.ImageXindex = 7; break;

            case 15: Actor.ImageXindex = 8; break;
            }

            Actor.UpdateFacing(Actor.Facing);
            Vector3           update   = (float)t.ElapsedGameTime.TotalSeconds * Actor.Speed * new Vector3(Actor.Facing, 0);
            CollisionCylinder CheckBox = Actor.GetBounds(update);

            foreach (Actor y in targets)
            {
                if (Actor != y)
                {
                    Vector3 adjust = (CheckBox.Intersection(y.Bounds));
                    update -= adjust;
                }
            }


            Actor.AdjustUpdateVector(update);
        }
Пример #2
0
      public override void Update(GameTime t, Dictionary <string, Actor> .ValueCollection targets)
      {
          UpdateFrame(t);

          switch (frame)
          {
          case 0:
              updateAmount = 0f;
              fatigue      = -1f;
              Actor.UpdateFacing(Vector2.Zero);

              AvailableHigh.LStickAction = null;
              AvailableLow.LStickAction  = null;
              AvailableHigh.NoButton     = null;
              AvailableLow.NoButton      = null;
              updateZ = 3f;

              break;

          case 1: fatigue = -3f; updateAmount = 9f; break;

          case 2: fatigue = 0f; break;

          case 5:
              updateAmount = 2f; updateZ = 0;
              break;

          case 8:
              updateAmount = 0f;
              break;

          case 12:

              AvailableHigh.LStickAction = "DashJump";
              AvailableLow.LStickAction  = "Dash";
              AvailableHigh.NoButton     = "FightStance";
              AvailableLow.NoButton      = "FightStance";
              break;
          }

          Vector3           update   = (float)t.ElapsedGameTime.TotalSeconds * Actor.Speed * new Vector3(direction * updateAmount, updateZ);
          CollisionCylinder CheckBox = Actor.GetBounds(update);
          bool legal = true;


          foreach (Actor y in targets)
          {
              Vector3 adjust = (CheckBox.Intersection(y.Bounds));
              update -= adjust;
          }


          Actor.AdjustUpdateVector(update);
      }
Пример #3
0
        public override void Update(GameTime t, Dictionary <string, Actor> .ValueCollection targets)
        {
            UpdateFrame(t);

            switch (frame)
            {
            case 0:
                updateAmount = 6f;
                fatigue      = -.5f;
                Actor.UpdateFacing(direction);
                AvailableHigh.LStickAction = null;
                AvailableLow.LStickAction  = null;
                AvailableHigh.NoButton     = null;
                AvailableLow.NoButton      = null;
                break;

            case 1: fatigue = 0f; break;

            case 2: fatigue = 0f; break;

            case 4:
                updateAmount = 0f;
                break;


            case 14:

                AvailableHigh.LStickAction = "DashJump";
                AvailableLow.LStickAction  = "Dash";
                AvailableHigh.NoButton     = "FightStance";
                AvailableLow.NoButton      = "FightStance";
                break;
            }


            Vector3           update   = (float)t.ElapsedGameTime.TotalSeconds * Actor.Speed * updateAmount * new Vector3(direction, 0);
            CollisionCylinder CheckBox = Actor.GetBounds(update);
            bool legal = true;

            foreach (Actor y in targets)
            {
                Actor.UpdateVector += (CheckBox.Intersection(y.Bounds)); //Collision Detection. Ideally reduces movement to outside collision bounds.
            }
        }
Пример #4
0
        public override void Update(GameTime t, Dictionary <string, Actor> .ValueCollection targets)
        {
            UpdateFrame(t);
            switch (frame)
            {
            case 0: Actor.ImageXindex = 0; break;

            case 114: Actor.ImageXindex = 1;
                break;

            case 115: Actor.ImageXindex = 2;
                break;

            case 117: Actor.ImageXindex = 1;
                break;

            case 118: Actor.ImageXindex = 0;
                break;

            case 119: Actor.ImageXindex = 1; break;

            case 120: Actor.ImageXindex = 2; break;

            case 122: Actor.ImageXindex = 1; break;
            }

            Actor.UpdateFacing(Vector2.UnitX);
            Vector3           update   = Vector3.Zero;
            CollisionCylinder CheckBox = Actor.GetBounds(update);

            foreach (Actor y in targets)
            {
                if (Actor != y)
                {
                    Vector3 adjust = (CheckBox.Intersection(y.Bounds));
                    update -= adjust;
                }
            }


            Actor.AdjustUpdateVector(update);
        }
Пример #5
0
        public override void Update(GameTime t, Dictionary <String, Actor> .ValueCollection targets)
        {
            UpdateFrame(t);

            Vector3 update = (float)t.ElapsedGameTime.TotalSeconds * Actor.Speed * new Vector3(Actor.Facing, 0);


            switch (frame)
            {
            case 0:
                Actor.ImageXindex = 1; Actor.ImageYindex = 0;
                update           /= 4;

                break;

            case 1: Actor.ImageXindex = 1; Actor.ImageYindex = 0;
                update /= 4;

                break;

            case 2: Actor.ImageXindex = 0; Actor.ImageYindex = 0;
                update /= 4;

                break;

            case 3: Actor.ImageXindex = 1; update /= 4;
                break;

            case 4:
                Actor.ImageXindex = 1; Actor.ImageYindex = 0;
                update           /= 4; break;

            case 5:
                Actor.ImageXindex = 1; Actor.ImageYindex = 0;
                update           /= 4; break;

            case 6:
                Actor.ImageXindex = 1; Actor.ImageYindex = 0;
                update           /= 4; break;

            case 7:
                Actor.ImageXindex = 1; Actor.ImageYindex = 0;
                update           /= 4; break;

            case 8:
                Actor.ImageXindex = 1; Actor.ImageYindex = 0;
                update           /= 4; break;

            case 9:
                Actor.ImageXindex = 1; Actor.ImageYindex = 0;
                update           /= 4; break;

            case 10: Actor.ImageXindex = 0; Actor.ImageYindex = 0;
                update /= 2; break;

            case 11: Actor.ImageXindex = 0; Actor.ImageYindex = 0;
                update /= 2; break;

            case 12: Actor.ImageXindex = 0; Actor.ImageYindex = 0;
                update /= 2; break;

            case 13: Actor.ImageXindex = 0; Actor.ImageYindex = 0;
                update /= 2; break;

            case 14: Actor.ImageXindex = 0; Actor.ImageYindex = 0;
                update /= 2; break;



            default: Actor.ImageYindex = 0;



                break;
            }


            CollisionCylinder CheckBox = Actor.GetBounds(update);
            bool legal = true;

            Actor.UpdateVector = update;
            foreach (Actor y in targets)
            {
                if (Actor != y)
                {
                    Vector3 adjust = (CheckBox.Intersection(y.Bounds));
                    update -= adjust;
                }
            }


            Actor.AdjustUpdateVector(update);
        }