Beispiel #1
0
 /// <summary>
 /// Makes the ninja wall jump.
 /// </summary>
 /// <param name="fLeft"></param>
 public void Action_WallJump(Command c)
 {
     if (c.CollidesWithConnectedPlatforms(DrawFrame()) != null)
     {
         velocity.Y = NinjaJumpHeight;
         Action_Move(c.FacesLeft);
         actionState = NinjaActionState.WallJumping;
     }
 }
Beispiel #2
0
 /// <summary>
 /// Makes the ninja slide on a wall associated with the command passed in.
 /// </summary>
 public void Action_WallSlide(Command c)
 {
     if (c.CollidesWithConnectedPlatforms(DrawFrame()) != null)
     {
         actionState = NinjaActionState.WallSliding;
     }
 }
Beispiel #3
0
        /// <summary>
        /// Makes the ninja climb a ledge associated with the command passed in.
        /// </summary>
        /// <param name="c"></param>
        public void Action_LedgeClimb(Command c)
        {
            Platform p = c.CollidesWithConnectedPlatforms(DrawFrame());
            if (p == null) return;

            if (GetDrawFrameY() < p.GetDrawFrameY())
            {
                actionState = NinjaActionState.WallClimbing;
                //animatedFrameSlide(new Point(NINJA_WIDTH, 0), 15, true);
                //animatedFrameSlide(new Point(0, GetDrawFrameY() - p.GetDrawFrameY()), 15, false);
                WorldObjectMove(NINJA_WIDTH, GetDrawFrameY() - p.GetDrawFrameY());
                velocity.Y = 0;
            }
        }