Help with a skribbl.io clone

Hi all, I’m making a skribbl.io clone, in which people join using a game ID, get assigned a word and have to draw that on the canvas. I’ve managed to code to allow users to join game rooms and have their names displayed on a who’s-playing board.

But I’m having trouble with the actual game. So basically what I’m trying to accomplish is:
for example, I’m user3. If it’s my turn, show me a canvas with touchdraw, and then keep sending an image of my canvas to realtime db, and then display it in an image for others in the same room. If it’s not my turn, I want to hide the canvas and display an image of the current player’s canvas. There’ll be a text input that the user has to use to guess what the artist is drawing.

Here’s what I have so far:
image




(function ‘play’ fetches a random word from the API, it’s working fine)

It’s not like I have a bug as such, but I’m just stuck on where to proceed and what to do next. Any help would be much appreciated. Thanks!

What’s one specific thing that isn’t working?

1 Like

I haven’t done much to ‘not work’, I just don’t know what to do in order to loop through all the players, assign them a word, and allow all the other players to guess it, while keeping the drawings and guesse in sync with everyone else in the game room.