Class HitWindows

A structure containing timing data for hit window based gameplay.

Constructors

Properties

empty: HitWindows = ...

An empty hit windows with only misses and perfects. No time values are provided (meaning instantaneous hit or miss).

Methods

  • Given a time offset, whether the hit object can ever be hit in the future with a non-miss result. This happens if time offset is less than what is required for lowest successful hit result.

    Parameters

    • timeOffset: number

      The time offset.

    Returns boolean

    Whether the hit object can be hit at any point in the future from this time offset.

  • Retrieves a mapping of hit results to their timing windows for all allowed hit results.

    Returns Generator<[HitResult, number], any, unknown>

  • Check whether it is possible to achieve the provided hit result.

    Parameters

    Returns boolean

    Whether the hit result can be achieved.

  • Retrieves the hit result for a time offset.

    Parameters

    • timeOffset: number

      The time offset.

    Returns HitResult

    The hit result, or HitResult.None if timeOffset doesn't result in a judgement.

  • Sets hit windows with values that correspond to a difficulty parameter.

    Parameters

    • difficulty: number

      The parameter.

    Returns void

  • Retrieves the hit window for a hit result. This is the number of +/- milliseconds allowed for the requested result (so the actual hittable range is double this).

    Parameters

    Returns number

    One half of the hit window for result.