mwg API
    Preparing search index...

    Function sfxSeed

    • A reproducible seed for an effect: the same id on the same game frame (and the same ordinal within that frame) always gives the same number, so a replay or a lockstep peer hears exactly what the original run heard, and audio never perturbs the simulation.

      Parameters

      • id: string
      • frame: number
      • ordinal: number = 0

      Returns number

      import { sfxSeed } from '@datamoc/mwg/audio';

      sfxSeed('arrow', 120) === sfxSeed('arrow', 120); // true