Black Trigram (흑괘) - Korean Martial Arts Combat Simulator API - v0.7.0
    Preparing search index...

    Function determineFallDirection

    • Determines fall direction from attack vector and player facing

      Calculates which direction the player should fall based on:

      • Attack vector (direction of incoming force)
      • Player facing direction (from stance)
      • Attack impact point (high/low)

      Korean terminology:

      • 전방낙법 (Jeonbang Nakbeop): Forward fall from rear attacks
      • 후방낙법 (Hubang Nakbeop): Backward fall from frontal attacks
      • 측방낙법 (Cheukbang Nakbeop): Side fall from lateral attacks

      Parameters

      • attackAngle: number

        Angle of attack in radians (0 = from front)

      • playerFacing: number

        Player facing angle in radians

      • attackHeight: "low" | "high" | "mid" = "mid"

        Attack height: 'high', 'mid', or 'low'

      Returns FallType

      Fall type to use for animation

      // Attack from behind while facing forward
      const fallType = determineFallDirection(Math.PI, 0, 'mid');
      // Returns: 'forward' (pushed forward)

      // Attack from front while facing forward
      const fallType = determineFallDirection(0, 0, 'mid');
      // Returns: 'backward' (pushed backward)

      // Attack from left side
      const fallType = determineFallDirection(-Math.PI/2, 0, 'mid');
      // Returns: 'side_left'

      낙법방향결정