/// <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; } }
/// <summary> /// Make the ninja throw its held item /// </summary> public void Action_ThrowItem(Command c) { if (HeldItem != null) { HeldItem.isFired = true; Point direction = new Point(c.secondaryTouchLocation().X - GetCenter().X, c.secondaryTouchLocation().Y - GetCenter().Y); HeldItem.SetDirection(direction); HeldItem = null; } }
/// <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; } }
/// <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; } }