Log inGet started
World

First-person survival horror game called…

Branchmain
Branchesmain
Commit31ce1f0625

README.md

Drift (component)

Drifting ambient air particles around the entity it sits on: fireflies, cherry blossom petals, autumn leaves, dust motes, pollen, embers, snow, mist wisps, waterfall spray, ash, glowing spores, light drizzle, magic sparkles or lantern sparks. Put it on an entity standing at the middle of the floor of the area you want filled (at any height, anywhere in the world); it needs no other components. Use a synced entity (entity.spawnSynced) so every player sees the same field.

local e = entity.spawnSynced("Petals")
e.component.add("Drift", { style = "cherryPetals", mood = "calm", density = 0.8 })

-- fireflies that come out at dusk and go at dawn with worldClockKit's WorldClock
entity.spawnSynced("Fireflies").component.add("Drift", { style = "fireflies", followClock = "auto" })

Fields (all synced): style, width / height / depth (0 = style default), density (0..1, fades over fadeSeconds), fadeSeconds, windDirection / windStrength (-1 = style default), mood (calm | normal | windy), tint ("#rrggbb") and tintAmount, followCamera (auto | on | off), quality (auto | high | medium | low), sizeScale, brightness, followClock (off | auto), seed, playing.

followClock = "auto" follows the scene's worldClockKit WorldClock when there is one: night styles (fireflies, glowSpores, lanternSparks) fade in at dusk, glow brighter as it darkens and fade out at dawn; day styles (dustMotes, pollen, cherryPetals) do the opposite. Without a WorldClock it changes nothing. quality = "auto" picks low on phones, tablets and Android, medium in a desktop browser and high in the native app.

Changing density fades the field; changing any other field cross-fades it to the new settings. require("ambientDrift.api").forEntity(e) returns the live field for fadeTo and setStyleParams. It plays in play mode only. See the package README for every style and the particle counts per quality tier.