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()
.
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> 🧟♀️ 99% 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>
nothing