DatapawWolf wrote:Ta daa!
Finally NodeJS + SockJS module + Construct 2's WebSocket plugin = working server!
Done in less than 10 events (subtracting debug stuff). Each click in the game sends a message to the server which causes the server to increment the score variables. Every 100ms, the server then broadcasts the server variable in a message to all connected clients which is then parsed by said clients and passed to a specific function which updates their score client-sided.
Edit: so the screen isn't bloated with data, the server only pushes the current score to the console up to once a second and only if it has changed.
Users browsing this forum: No registered users and 3 guests