Coder Social home page Coder Social logo

snakegame's Introduction

Snake Game

A classic Snake game built using HTML, CSS, and JavaScript. Enjoy the nostalgic game where you control a snake to eat food and grow longer, avoiding collisions with the walls and yourself.

Table of Contents

Gameplay

Use the arrow keys to control the snake. The objective is to eat the food that appears on the board. Each time the snake eats the food, it grows longer, and your score increases. Be careful not to run into the walls or yourself, or it's game over!

Features

  • Classic Snake game mechanics
  • Real-time score tracking
  • High score tracking stored in the browser's local storage
  • Background music and sound effects for food, movement, and game over events

Installation

  1. Clone the repository to your local machine:

    git clone <repository-url>
  2. Navigate to the project directory:

    cd SnakeGame
  3. Ensure you have a web server to serve the files, such as Live Server for Visual Studio Code.

Usage

  1. Open the project directory in your code editor.
  2. Serve the index.html file using your preferred web server or by opening it directly in your browser.
  3. Use the arrow keys to start the game and control the snake.

Files

  • index.html: The main HTML file containing the game structure.
  • style.css: The CSS file for styling the game.
  • script.js: The JavaScript file containing the game logic.
  • music/: Directory containing sound files used in the game.
    • food.wav: Sound played when the snake eats food.
    • gameover.wav: Sound played when the game is over.
    • move.mp3: Sound played when the snake changes direction.
    • game.mp3: Background music played during the game.

snakegame's People

Contributors

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