GitHub Contributions Snake

turn github contribs to snake game

当前为 2024-08-19 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

作者
gv3.dev
评分
0 0 0
版本
2024-07-19
创建于
2024-08-19
更新于
2024-08-19
大小
4.7 KB
许可证
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.