pedroferreira37 / snake-game

Justy playing with functional programming

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Snake Game in JavaScript

This is a classic Snake game written in JavaScript without using the HTML5 canvas element for rendering graphics. The game is played by controlling a snake that moves around the screen and eating food to grow longer. The game is over when the snake collides with the walls or its own body.

Installation

Clone the repository: git clone https://github.com//.git Open the index.html file in a web browser to start the game. Gameplay The player controls the snake using the arrow keys on the keyboard. The snake starts with a length of 1 and moves in the direction of the arrow key that is pressed. When the snake eats a piece of food, its length increases by one and the player earns points. The game ends when the snake collides with the walls or its own body.

Features

  • Randomly generated food
  • Collision detection with walls and snake's own body
  • Scoring system to keep track of points

Future Improvements

  • Add sound effects and background music
  • Implement different game modes and difficulty levels
  • Add power-ups and obstacles for the player to avoid or collect
  • Contributing
  • Contributions are welcome! If you'd like to contribute to this project, please fork the repository and create a pull request with your changes.

About

Justy playing with functional programming


Languages

Language:JavaScript 86.6%Language:CSS 8.4%Language:HTML 5.0%