This project is a web-based Snake game that utilizes HTML, CSS, and JavaScript for the client-side, with a Java server for saving game data. The game allows players to control a snake, collect food, and track their scores.
The project is organized into two main directories: client and server.
- index.html: The main HTML document that sets up the game canvas and includes references to the CSS and JavaScript files.
- styles/main.css: Contains styles for the game, enhancing the visual appearance.
- scripts/snake.js: Implements the game logic, including snake movement, collision detection, and score tracking.
- README.md: Documentation for the client-side, including instructions on how to run the game.
- src/Main.java: The entry point for the Java server application, handling incoming requests related to game data.
- src/GameSaveHandler.java: Logic for saving and retrieving game data, such as high scores or player progress.
- pom.xml: Maven configuration file specifying project dependencies and build settings.
- README.md: Documentation for the server-side, including instructions on how to run the server.
To run the Snake game, follow these steps:
- Clone the Repository: Clone this repository to your local machine.
- Set Up the Client:
- Navigate to the
clientdirectory. - Open
index.htmlin a web browser to start the game.
- Navigate to the
- Set Up the Server:
- Navigate to the
serverdirectory. - Use Maven to build and run the server:
mvn clean install mvn exec:java -Dexec.mainClass="Main"
- Navigate to the
- Play the Game: Once the server is running, you can play the game in your browser. The game will save high scores on the server.
This project has a 10-step improvement plan to enhance the game over time, including adding multiplayer functionality, improving graphics, and implementing user authentication.
This project is licensed under the MIT License - see the LICENSE file for details.