Language | Rendering | Networking |
---|---|---|
TypeScript | Canvas | Socket.io |
rivet.yaml
file. For the purposes of this demo,
you can copy and paste this config into your file:
@rivet-gg/api
client/Client.ts
:
connect
function in client/Client.ts
and replace it with the following:
server/index.ts
:
setupConnection
function in server/index.ts
and replace it with the following:
npm run start
, run rivet run start
and validate the game still connects.
What is "rivet run"?
rivet run
command automatically adds important environment variables required for running a game to
whatever script you choose to run with it. In this case, it is reading the start
script defined in
rivet.yaml
.Optional: Check for connectivity to Rivet
Ctrl + Shift + I
(or Cmd + Option + I
on macOS) to open the dev tools.POST
request to https://api.rivet.gg/matchmaker/lobbies/find
. This means you are
successfully connected through Rivet.What does this do?
rivet.game
. Share the link with a friend to play your game on Rivet! π