Sniper pixelcanvas !

Mets un viseur de snipeur sur le pointeur et fais le bruit d'un sniper lorsque l'on clique.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name        Sniper pixelcanvas !
// @namespace   ?
// @description Mets un viseur de snipeur sur le pointeur et fais le bruit d'un sniper lorsque l'on clique.
// @include     https://pixelplanet.fun/*
// @version     1.1
// @grant       none
// ==/UserScript==


var canvas = document.getElementsByClassName("viewport")[0];
canvas.style.cursor = "crosshair";

var audio = document.createElement("audio");
audio.src = "http://www.universal-soundbank.com/sounds/12019.mp3";
audio.id = "tirAudio";
document.getElementsByClassName("viewport")[0].appendChild(audio);

canvas.addEventListener('click', event => {
  document.getElementById('tirAudio').play();
  canvas.style.cursor = "crosshair";
});