Colyseus - Tic Tac Toe Multiplayer Example


#1

I ported the Endel Dreyer’s Colyseus example tic-tac-toe to the Defold. Server code is as it is, but I made slightly changes on client side code.
Sorry if I made a terrible design decision, feel free to shout them on my face :expressionless:

You can download the project from github.
Git repo: https://github.com/selimanac/defold-colyseus-tic-tac-toe

First, you need to install Node.js.
Server is in the <project_path>/server folder.
You can install and start the server from cli:

> cd /<project_path>/server
> npm install
> npm start

For better understanding check out the room implementation and registering room codes.

Then you can start clients from Defold.

There are known issues:

  • Fixed: Sometimes client.onError doesn’t triggered when there is no connection/server GitHub issue: #6
  • There is a flow problem which you should wait until onJoin to be completed before changing the turn(or you can run it twice). #

Colyseus - Multiplayer Game Client & Server
#2

Cool! Thank you for sharing!