Skip to content

lilskywalkr/snake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🐍 Snake Game (JavaScript)

This is a classic Snake Game implemented using pure HTML, CSS, and JavaScript, built back in high school (3rd grade!).
Move the snake around, eat fruits, grow your tail, and try not to crash into yourself!


🎮 How to Play

  • Use arrow keys (⬅️⬆️➡️⬇️) to control the snake.
  • Eat fruits (🍎) to grow longer and earn points.
  • Avoid crashing into your own tail — otherwise, it's Game Over!

🛠️ Technologies Used

  • HTML5: Structure of the game elements (board, snake, fruit, score display).
  • CSS3: Styling the game board, snake, and fruit.
  • Vanilla JavaScript:
    • Dynamic movement of the snake.
    • Fruit spawning at random locations.
    • Collision detection.
    • Snake growth mechanics.
    • Score tracking and game restart.

📋 Notes

  • The snake wraps around the screen if it hits a wall (teleport effect).
  • Each time the snake eats a fruit, a new tail segment is added.
  • Fruit never spawns on the snake's body.
  • Collision with your own tail ends the game and displays "Game Over".

🚀 How to Run

Simply open the index.html file in any modern web browser (Chrome, Firefox, Edge).

No installation needed!


🖼️ Overview

snake1 snake2


🎓 A Little Backstory

This project was created back in high school (3rd grade) — a personal milestone showing early passion for coding and game development!


Happy Playing! 🎮✨

About

The snake game in javascript using DOM. I made this back in highschool in 2k19.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors