Skip to content

AkhilRaja/Snake-2P

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snake-2P

Try out the game at. http://akhilraja.github.io/Snake-2P/

Objectives

  • Create Snake class, which comprises of an array of square objects to constitute the Snake body.
  • Create another two arrays to store x and y coordinates such that they keep track of each pixel of each square node constituting the Snake body, so that using these arrays, the snake can be moved at any desired speed.
  • Create movement logic, such that on pressing the required keys or the combination of those keys, vertical, horizontal or diagonal movement can be obtained.
  • Create variables to hold the score and the number of lives of both the Snakes.
  • Create logics to determine when the game is over and display it on the screen.
  • Features

    1. This is 2P version of Snake built using Javascript.
    2. Use the WASD and Arrow keys to control the snake.
    3. There are various powerups/bad stuff that the snake can eat to either grow or shrink and score points.
    4. The Snake dies if it hits the wall or another Snake.
    5. The first to die looses the game.

    Alt text

    About

    This is 2P version of Snake. Built using Javascript.

    Topics

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published

    Languages