O jogo da cobrinha classico feito em Html, Css e JavaScript, feito com intuito de estudos! Também com versão multiplayer usando WebSocket.
Clone o repositório ou acesse o deploy para jogar:
https://snakegame-one-opal.vercel.app
Este projeto nasceu de uma vontade de aprender e evoluir. Os principais objetivos por trás dele são:
- Aprofundar o entendimento de JavaScript puro, manipulação de Canvas, game loops e comunicação em tempo real com WebSocket
- Demonstrar capacidade de construir uma aplicação completa do zero, com frontend, servidor HTTP e servidor WebSocket integrados
- Disponibilizar o código de forma aberta para que outras pessoas possam estudar, contribuir e se inspirar
- HTTP Server: Porta 3000 (servindo os arquivos HTML/CSS/JS)
- WebSocket Server: Porta 8080 (gerenciando o jogo multiplayer)
O projeto foi desenvolvido com as seguintes dependências:
- HTML – HTML5
- CSS – CSS3
- JavaScript – ECMAScript 2024
- WebSocket - (biblioteca
wspara comunicação em tempo real) - Node.js para os servidores
- Node.js instalado
git clone https://github.com/seu-usuario/snakegame.git
cd snakegamenpm installEm dois terminais separados:
# Terminal 1 — servidor HTTP
npm start
# Terminal 2 — servidor WebSocket (multiplayer)
npm run serverhttp://localhost:3000
The classic Snake game built with HTML, CSS, and JavaScript for educational purposes! It also includes a multiplayer version using WebSockets.
Clone the repository or visit the live deployment to play:
https://snakegame-one-opal.vercel.app
This project was born out of a desire to learn and grow. The main objectives behind this project are:
- To deepen the understanding of vanilla JavaScript, Canvas manipulation, game loops, and real-time communication via WebSockets
- To demonstrate the ability to build a complete application from scratch, integrating a frontend, an HTTP server, and a WebSocket server
- To make the code open-source so others can study, contribute, and find inspiration
- HTTP Server: Port 3000 (serving HTML/CSS/JS files)
- WebSocket Server: Port 8080 (managing the multiplayer game)
The project was developed using the following dependencies:
- HTML – HTML5
- CSS – CSS3
- JavaScript – ECMAScript 2024
- WebSocket - (
wslibrary for real-time communication) - Node.js for the servers
- Node.js installed
git clone https://github.com/your-username/snakegame.git
cd snakegamenpm installIn two separate terminals:
# Terminal 1 — HTTP server
npm start
# Terminal 2 — WebSocket server (multiplayer)
npm run serverhttp://localhost:3000
by caiothevisual #caiobavisuals #snakegame #html #css #javascript


