GitHub Contributions Snake

turn github contribs to snake game

作者
gv3.dev
今日安裝
0
安裝總數
2
評價
0 0 0
版本
2024-07-19
建立日期
2024-08-19
更新日期
2024-08-19
授權條款
MIT
腳本執行於

GitHub Contributions Snake 🐍🍎

Please note that this script is not finished & requires more work. It was just a quick little project cuz I was bored. However, it is usable & fully functional, it just isn't at it's best. (yet) :)

This repository contains a JavaScript implementation of a Snake game that can be played on the GitHub contributions grid. The script automatically sets up the game, and the snake can be controlled using the arrow keys. The snake aims to eat the food that appears on the grid, growing in length with each piece of food consumed.

Features

  • Snake Movement: Control the snake using the arrow keys.
  • Food Generation: Randomly places food on the grid that the snake aims to eat.
  • Collision Handling: Prevents the snake from running into itself.

How It Works

The script continuously executes the following steps:

  1. Initialize Game: Sets up the grid, snake, and food.
  2. Handle Input: Listens for arrow key presses to control the snake's direction.
  3. Move Snake: Moves the snake in the specified direction, handles food consumption, and grows the snake.

Installation

To use this script with Tampermonkey:

  1. Install Tampermonkey: Install the Tampermonkey extension for your browser.
  2. Create a New Script: Open Tampermonkey, create a new script, and paste the code below into it.
  3. Save and Enable: Save the script and ensure it is enabled.
  4. Play the Game: Open GitHub and navigate to your contributions grid. Use the arrow keys to control the snake.