Description

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().

Signature

partyConnect(server, appName, [roomName], [callback])

Parameters

server

string: the server to connect to, e.g. wss://yourserver.herokuapp.com or wss://demoserver.p5party.org

appName

string: the name of your app, e.g. jbakse-pong

roomName (optional)

string: the name of the room, e.g. main

callback (optional)

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>

Returns

nothing