Skip to content

Geno419/snake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gild's Snake Game

Hey folks! 👋 Welcome to my snake game – a classic arcade game built with JavaScript and HTML canvas. Dive into the code and have fun customizing your own version!

Getting Started

  1. Clone the repository:

    git clone https://github.com/Geno419/snake.git
  2. Open index.html in your web browser.

  3. Control the snake using arrow keys (Up, Down, Left, Right) or W, A, S, D keys.

Code Overview

Snake Logic

  • The snake is controlled by arrow keys or W, A, S, D keys.
  • The game is initialized with a grid-like canvas with a specified number of rows and columns.
  • The snake grows longer each time it consumes the food (apple).

Images

  • Utilizes images for the background, apple, and snake head.
  • Customize images by replacing the existing ones in the images folder.

Styling

  • The game's styling is defined in the style.css file.
  • Feel free to tweak styles to match your preferences.

Gameplay

  • The game ends if the snake hits the canvas boundaries or collides with itself.
  • Score is displayed, and the game can be restarted after reaching the game over state.

Customization

  • Images: Replace images in the images folder to give your game a unique look.
  • Styling: Modify the styles in style.css to personalize the game's appearance.

Gameplay

  • Control: Use arrow keys (Up, Down, Left, Right) or W, A, S, D keys to control the snake.
  • Scoring: Increase your score by eating apples. The game ends if the snake collides with the canvas boundaries or itself.

Access the Game

The game is hosted on GitHub Pages and can be accessed here.

License

Feel free to enjoy and customize this snake game for your own use. No need for contributions – let's keep it personal and fun!


Have a blast playing and customizing your snake game! If you have any questions or need assistance, feel free to reach out. Happy coding! 🐍🕹️

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published