Need help with Socket.IO

I am making a game framework with Socket.IO. The game currently has players that seem to not be connected, and a not working canvas with key events. Please tell me what I’m missing!

Repl link: https://replit.com/@element1010/SocketIO-Test?v=1#index.js

Is the Repl private? I’m getting a 404 error.

Sorry, the link is http://repl.it/@element1010/SocketIO-test?v=1

P.S. I don’t use private Repls, I don’t have cycles (which would be appreciated)

1 Like

Try to change all socket.emit and socket.on inside the connection handler to user.emit and user.on , so you can treat users individually.

Other thing that I noticed is that you are initializing the player respawn at 50,50 but you are not updating their movement, this might cause the players to appear in the same spot and being unable to move.

It may have other things too but that’s all I can find by now.

2 Likes

I don’t really get it, can I invite you to collaborate?

I have a Socket.IO template you might want to check out :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.