Log inGet started
World

Pixel Ledges: 2D Platformer Kit with Sprites, Tilemaps, Wall Jumps and Dash

README.md

sfx

Synthesised 8-bit sound effects for platformers and arcade games: jump, land, hard landing, dash, wall jump, gem, checkpoint, death, game over, level clear and UI click. Each sound is built from square (with duty cycle), stepped triangle and 15-bit LFSR noise voices with pitch sweeps, vibrato and a chip-style stepped envelope, baked once into a soundClip under chipSfx.sounds and shipped with the package. chipSfx.bake regenerates them from Sfx.PRESETS.

twoDKit plays them itself (through twoDKit.juice) on every peer for the moments that peer sees: your own at full volume, other players' quieter and fading out with distance. Nothing goes over the network.

API

  • Sfx.play(name, opts?) -> boolean: play one sound on this peer. opts: isLocal (false for someone else's moment), x, y, listenerX, listenerY (distance fade), volume, pitch (a small random pitch jitter is the default). Each sound has a short cooldown so a burst never stacks.
  • Sfx.volume (default 0.55) and Sfx.setVolume(v), Sfx.muted and Sfx.setMuted(b): this peer's master volume and mute. twoDKit's Player2D.sfxVolume sets it too.
  • Sfx.remoteVolume (0.45) and Sfx.hearing (18 tiles): how loud other players are, and how far away they fade out.
  • Sfx.render(nameOrPreset) -> { number }: the mono samples at Sfx.RATE (22050 Hz), for your own sounds, e.g. Sfx.render({ voices = { { wave = "square", duty = 0.25, dur = 0.1, f0 = 300, f1 = 900, decay = true } } }).
  • Sfx.PRESETS, Sfx.NAMES, Sfx.duration(name), Sfx.peak(pcm), Sfx.note(midi), Sfx.clipId(name).
local Sfx = require("chipSfx.sfx")
Sfx.setVolume(0.3)
Sfx.play("click")