Skip to content

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.

Notifications You must be signed in to change notification settings

GPMLAD/SnakeGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snake Game

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.

About the Game

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!

How to Play

  • 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.

Technologies Used

  • HTML
  • CSS
  • JavaScript and TypeScript

How to Run the Game

Online

To play the game online, simply visit the following link: Snake Game

Local

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.

Contributions

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!

License

I Don't Know

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published