This is a simple Snake Game that I developed with the intention of having fun while learning more about implementing dynamism using basic elements such as <canvas>
. The project also aimed to practice transitioning from a JavaScript project to TypeScript and using classes with JavaScript.
This is a classic snake game where the player controls a snake that moves around the game board. The objective is to collect food items that appear randomly on the board, which causes the snake to grow longer. As the snake grows, the player gains points.
The game also features increasing speed as the player's score increases, making it more challenging to navigate and avoid collisions with the walls or the snake's own body. The game continues until the snake fills the entire board, and the player can challenge themselves to achieve the highest score possible.
Enjoy the thrill of the classic snake game and see how long you can grow your snake!
- Controls: Use the arrow keys on your keyboard to control the movement of the player.
- Movement Limitation: Only one movement is allowed per step, making the game more strategic.
- Speed Increase: As the player's score increases, the speed of the game will also increase until it reaches its maximum speed.
- Desktop Only: Please note that the game currently works only on desktop devices.
- Game Over: The game ends when the player's character (e.g., snake) collides with the wall or bites its own body.
- HTML
- CSS
- JavaScript and TypeScript
To play the game online, simply visit the following link: Snake Game
To run the game on your local machine, follow these steps:
Clone the repository to your local machine using Git:
git clone https://github.com/gpmlad/SnakeGame.git
Open the project folder and navigate to the index.html file.
If you have a development server installed (like "Live Server" for Visual Studio Code), you can use it to serve the game. Simply right-click on the index.html file and choose "Open with Live Server". The game will be accessible at http://127.0.0.1:5500/index.html or a similar address provided by your development server.
This project was developed with the purpose of learning and having fun. However, if you'd like to contribute with improvements, bug fixes, or new features, feel free to submit a pull request. All contributions are welcome!
I Don't Know