Giter Site home page Giter Site logo

snake-game's Introduction

Snake Game in JavaScript

This is a simple snake game developed using JavaScript, HTML and CSS.

How to Play

  • Use the arrow keys on your keyboard to move the snake.
  • The objective of the game is to eat as many fruits as possible to grow the snake.
  • The game ends when the snake hits the wall or itself.
  • You can restart the game by clicking on the "Restart" button.

How to Run

  • Download or clone the repository to your local machine.
  • Open the index.html file in your web browser.

Game Implementation

  • The game is implemented using HTML5 canvas element.
  • The snake and fruits are drawn on the canvas using JavaScript.
  • The game logic is also implemented using JavaScript.

Game Controls

The game can be played using the following arrow keys on your keyboard:

  • Up Arrow: Move the snake up.
  • Down Arrow: Move the snake down.
  • Left Arrow: Move the snake left.
  • Right Arrow: Move the snake right.

Game Features

The game has a score counter that keeps track of the number of fruits eaten. The game has a restart button that allows the player to restart once the game gets over.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.

Credits

snake-game's People

Contributors

shivam-hits avatar vaibhavtiw avatar

Stargazers

Atishay Tripathi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.