Git Product home page Git Product logo

javascript-snake-game--mini-project's Introduction

JavaScript-Snake-Game--mini-project

Summary

Classic Snake Game written in Vanilla JavaScript with the use of CSS grid. Simple functionality.

This is another from the mini-project series. This was a great learning expereince and good practice of CSS grid. The game is fully functional according to the classic Snake gameplay.

Live Site

https://nickmezacapa.github.io/JavaScript-Snake-Game--mini-project/

Work Still To Be Done:

  • I would like to add score keeping functionality as well as session high-score recording.

  • I would like to make the snake movement slightly smoother.

  • I would like for snake movement speed to gradually increase as the body length increases, providing progressive difficulty.

  • Some small styling adjustments to improve UI (unnecessary but will enhance user experience and serve as good practice).

  • For the sake of a mini project, all purposes are served.

PR requests welcomed!

Test Scenarios:

  • The user is able to move snake in either right, left, up or down directions.
  • When the user runs into a wall, the game is over and they are prompted to restart.
  • When the snake head runs into it's body, the game is over and the user is prompted to restart.
  • When the user runs into a food piece, the snake's body length increases by one segment.
  • The food segments that are added to the snake's body are added in green (snake body color), not yellow (food piece color).
  • As the snake moves, each segment follows the segment in front of it. The snake body will not move as one member, but rather "slither".
  • The snake is not able to move in the opposite direction and impose over it's own body. There are only 3 possible movement options.

Screenshots

live gameplay

snake-game-sc

game over alert, game restart confirm

snake-gameover-sc

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.