Esempio n. 1
0
        public override void Update(GameTime t, Dictionary <string, Actor> .ValueCollection targets)
        {
            UpdateFrame(t);

            switch (frame)
            {
            case 0: AvailableLow.LStickAction = null;

                AvailableHigh.LStickAction = null;
                AvailableLow.YButton       = null;
                AvailableHigh.YButton      = null;

                AvailableHigh.LStickAction = null;
                AvailableLow.YButton       = null;
                AvailableHigh.YButton      = null;
                AvailableHigh.NoButton     = null;
                AvailableLow.NoButton      = null;
                direction = Actor.Facing;
                break;

            case 5: hitBox.Location = Actor.Location; hitBox.Radius = Actor.Radius + attackLength + 5; hitBox.CenterAngle = (float)Math.Atan2(Actor.Facing.Y, Actor.Facing.X); break;

            case 4: hitBox.Location = Actor.Location; hitBox.Radius = Actor.Radius + attackLength; hitBox.CenterAngle = (float)Math.Atan2(Actor.Facing.Y, Actor.Facing.X); break;

            case 6: hitBox.Radius = 0; break;

            case 9:
                AvailableHigh.NoButton = "Standing";
                AvailableLow.NoButton  = "Standing";
                break;
            }

            Actor.UpdateFacing(direction);

            foreach (Actor y in targets)
            {
                if ((HitBox.IntersectsType(y.Bounds) && Actor != y)) //Collision Detection. Ideally reduces movement to outside collision bounds.
                {
                    // Combat TestGoes Here::
                    y.AttackResponse(this);
                    y.UpdateVector -= (Actor.Location - y.Location);
                    y.Move();

                    Actor.SetAction("MidBlock");
                }
            }
        }