GithubHelp home page GithubHelp logo

gpmlad / snakegame Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 7.29 MB

This is a simple Snake Game that I developed with the intention of having fun while learning more about implementing dynamism using basic elements such as <canvas>. The project also aimed to practice transitioning from a JavaScript project to TypeScript and using classes with JavaScript.

Home Page: https://gpmlad.github.io/SnakeGame/

HTML 3.02% JavaScript 48.57% CSS 3.65% TypeScript 44.76%
canvas class snake-game typescript

snakegame's Introduction

Snake Game

This is a simple Snake Game that I developed with the intention of having fun while learning more about implementing dynamism using basic elements such as <canvas>. The project also aimed to practice transitioning from a JavaScript project to TypeScript and using classes with JavaScript.

About the Game

This is a classic snake game where the player controls a snake that moves around the game board. The objective is to collect food items that appear randomly on the board, which causes the snake to grow longer. As the snake grows, the player gains points.

The game also features increasing speed as the player's score increases, making it more challenging to navigate and avoid collisions with the walls or the snake's own body. The game continues until the snake fills the entire board, and the player can challenge themselves to achieve the highest score possible.

Enjoy the thrill of the classic snake game and see how long you can grow your snake!

How to Play

  • Controls: Use the arrow keys on your keyboard to control the movement of the player.
  • Movement Limitation: Only one movement is allowed per step, making the game more strategic.
  • Speed Increase: As the player's score increases, the speed of the game will also increase until it reaches its maximum speed.
  • Desktop Only: Please note that the game currently works only on desktop devices.
  • Game Over: The game ends when the player's character (e.g., snake) collides with the wall or bites its own body.

Technologies Used

  • HTML
  • CSS
  • JavaScript and TypeScript

How to Run the Game

Online

To play the game online, simply visit the following link: Snake Game

Local

To run the game on your local machine, follow these steps:

Clone the repository to your local machine using Git:

git clone https://github.com/gpmlad/SnakeGame.git

Open the project folder and navigate to the index.html file.

If you have a development server installed (like "Live Server" for Visual Studio Code), you can use it to serve the game. Simply right-click on the index.html file and choose "Open with Live Server". The game will be accessible at http://127.0.0.1:5500/index.html or a similar address provided by your development server.

Contributions

This project was developed with the purpose of learning and having fun. However, if you'd like to contribute with improvements, bug fixes, or new features, feel free to submit a pull request. All contributions are welcome!

License

I Don't Know

snakegame's People

Contributors

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