Ejemplo n.º 1
0
 public void NormalAttack(object a_obj)
 {
     if (Stamina >= 1)
     {
         GameGlobals.ExecuteAttack(new Attack(this, 60, 1, Ori));
         Stamina--;
     }
 }
Ejemplo n.º 2
0
        public override void Update(Vector2 a_offset, SquareGrid a_grid)
        {
            //a_grid.GetSlotFromPixel(Position, Vector2.Zero).Filled = false;

            Vector2 originalPosition = Position;

            if (_state == State.DASHING)
            {
                if (Ori == GameGlobals.Orientation.LEFT)
                {
                    HSpeed = -20.0f;
                }
                else
                {
                    HSpeed = 20.0f;
                }
            }
            else
            {
                HandleInput(a_offset, a_grid);
            }


            if (_state == State.JUMP_ATTACKING)
            {
                Attack jumpAttack = new Attack(this, 0, 1, GameGlobals.Orientation.BOT);
                GameGlobals.ExecuteAttack(jumpAttack);
                if (jumpAttack.LandedHit)
                {
                    VSpeed = -JumpSpeed * 0.8f;
                }
            }

            StartAnimation();

            UpdateTimers();

            _wasOnGround = OnGround;

            base.Update(a_offset, a_grid);

            GameGlobals.CheckScroll(Position);

            //a_grid.GetSlotFromPixel(Position, Vector2.Zero).Filled = true;
        }