The Wavedash twin of the Newgrounds plugin: achievements, leaderboards and cloud saves, the same shape so a game
can switch, and stats and presence of Wavedash's own
Wavedash serves the game's page and puts its SDK in window.Wavedash before the game runs, so nothing is bundled;
off Wavedash (local, itch, GitHub Pages) there is none, and every call does nothing
Make the plugin when the game can draw, at the end of gameInit: Wavedash.init is called then, and until it is
Wavedash keeps its loading screen over the game
WavedashMedal is a Medal with the identifier of its Wavedash achievement; on Wavedash an unlock is sent as that
achievement and Wavedash shows its own toast in place of the engine's popup, off it the medal unlocks as any does
Wavedash refuses an achievement until it has loaded the player's, a moment after launch, so refused and earlier
unlocks are sent again every two seconds until it takes them; medals unlocked before, in the save, are sent too
Leaderboards are made from code: give the plugin a table of them, each with how it sorts and shows its scores,
and they are made at once, so each one exists from the first launch
The SDK checks its arguments' types and throws on a wrong one, so every call passes real booleans and whole
numbers and is caught; a game built with its own minifier keeps the SDK's names, see REFERENCE