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

    Function updateFacingTowardOpponent

    • Updates facing direction to point toward opponent

      Calculates target angle based on opponent position and updates body facing state with smooth rotation.

      Parameters

      • facing: BodyFacing

        Current body facing state

      • playerPosition: Position

        Player's current position

      • opponentPosition: Position

        Opponent's current position

      • deltaTime: number

        Time elapsed since last update in seconds

      • currentTime: number

        Current timestamp in milliseconds

      Returns BodyFacing

      Updated body facing state

      const updated = updateFacingTowardOpponent(
      facing,
      { x: 100, y: 200 },
      { x: 300, y: 200 },
      0.016,
      Date.now()
      );
      // Faces toward opponent (pointing right in this case)

      상대방향하기업데이트