Minimap

Simple minimap

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

You will need to install an extension such as Tampermonkey to install this script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         Minimap
// @namespace    http://tampermonkey.net/
// @version      2026-05-28
// @description  Simple minimap
// @author       You
// @match        https://bloxd.io/*
// @match        https://www.crazygames.com/game/bloxdhop-io
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const canvas = document.createElement("canvas");
    const ctx = canvas.getContext("2d");
    canvas.width = 150;
    canvas.height = 150;

    canvas.style.position = "fixed";
    canvas.style.top = "20px";
    canvas.style.right = "20px";
    canvas.style.background = "black";
    canvas.style.border = "2px solid white";
    canvas.style.zIndex = "9999";

   document.body.appendChild(canvas);

    let x = 75;
    let y = 75;

    document.addEventListener("keydown", (e) => {
        if (e.key === "w") y -= 5;
        if (e.key === "s") y += 5;
        if (e.key === "a") x -= 5;
        if (e.key === "d") x += 5;
    });

    function draw() {

        // Clear minimap
        ctx.clearRect(0, 0, canvas.width, canvas.height);

        // Draw green dot
        ctx.fillStyle = "lime";
        ctx.beginPath();
        ctx.arc(x, y, 5, 0, Math.PI * 2);
        ctx.fill();
        x = Math.max(5, Math.min(canvas.width - 5, x));
        y = Math.max(5, Math.min(canvas.height - 5, y));

        requestAnimationFrame(draw);
    }

    draw();
})();