Cloudburst: Rain, Snow, Storms and Fog for Your Game
README.md
weather
Cloudburst's API for game code and other kits.
local Weather = require("cloudburst.weather")
Weather.preset("night_storm_town", 30) -- fade into a storm over 30 s
Weather.set({ kind = "snow", intensity = 0.8 }) -- or pick a kind and how strong
Weather.cycle({ { "clear_day", 3 }, { "steady_rain", 2 }, { "night_storm_town", 4 } })
Weather.now().frame.rain -- how hard it is raining now, 0-1
Weather.onStrike(function(s) print(s.distance) end)
Weather.landsAt(x, z) -- where rain lands over a point
Weather.landings({ x, z }, 5, dt) -- drops landing near a point this frame
Weather.bind(asset.resolve("cloudburst.materials.cb_pond", "material")) -- on scene load
Weather.setFlashComfort(0.3) -- gentler lightning for this player
Lists for menus: presets(), kinds(), rainLooks(), snowLooks(), lightningStyles(),
splashStyles(), fogBanks(), describe(name). definePreset / defineKind add your own.