Code for multiplayer snake game with socket.io tutorial on the Traversy Media YouTube channel.
If you want to see how to deploy the game check out this video
Code for multiplayer snake game with socket.io tutorial
Code for multiplayer snake game with socket.io tutorial on the Traversy Media YouTube channel.
If you want to see how to deploy the game check out this video
After both players joined a room and someone looses, you can reenter a new game code.
If you reenter the old game code, no more game codes will be visible.
Console Error Log:
"Access to XMLHttpRequest at 'https://sleepy-island-33889.herokuapp.com/socket.io/?EIO=3&transport=polling&t=OCTigSW' from origin 'http://127.0.0.1:65497' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource."
"Access to XMLHttpRequest at 'https://sleepy-island-33889.herokuapp.com/socket.io/?EIO=3&transport=polling&t=OCTigSW' from origin 'http://127.0.0.1:65497' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
"
"Access to XMLHttpRequest at 'https://sleepy-island-33889.herokuapp.com/socket.io/?EIO=3&transport=polling&t=OCTigw6' from origin 'http://127.0.0.1:65497' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
"
"Failed to load sleepy-island-33889.herokuapp.com/socket.io/?EIO=3&transport=polling&t=OCTigw6:1
resource: net::ERR_FAILED"
On the video (one at brad traversys channel), around 15:00 seconds, while making the request from index.js , we are getting a cors error. The probable reason for this error maybe the current version of 4.1.2 and the version in client code is 2.3.0. I got the solution from one of the comments that reinstalling the older version solves the problem or you may include cors header while initializing socket. Maybe you should pin the comment or give any solution to this
Everytime I try to Join Room I get unknown code error. console logging room.sockets returns undefined and numClients always logs 0. io.sockets.adapter.rooms[roomCode] also logs undefined
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.