Connects to a p5.party server.
Call this function before calling any other p5.party functions, usually called in preload().
If this function is called in preload() , p5.js will wait for the connection to complete before calling setup().
<aside> 🧟
Using p5.js 2? p5.js 2 doesn't have preload(). Instead, call partyConnect() and partyLoadShared() in an async setup() and await them. See the p5.js 2 Quick Start Guide.
</aside>
partyConnect(server, appName, [roomName], [callback])
string: the server to connect to, e.g. wss://yourserver.herokuapp.com or wss://demoserver.p5party.org
string: the name of your app, e.g. jbakse-pong
string: the name of the room, e.g. main
function: function to be called when the connection is ready.
<aside> 🧟♀️ Most of the time you won’t need to provide a callback. Normally, you call partyConnect() from preload() and p5 will wait for the connection to complete before calling setup().
</aside>
p5.js 1: nothing
p5.js 2: a Promise that resolves when the connection is ready