您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
5/7/2025, 9:11:07 PM
- // ==UserScript==
- // @name My cube
- // @namespace Violentmonkey Scripts
- // @match https://johnbutlergames.com/games/opposite-day/1-2-1/index.html*
- // @grant none
- // @version 1.1
- // @author God NTSC Player
- // @description 5/7/2025, 9:11:07 PM
- // ==/UserScript==
- (function() {
- 'use strict';
- const imageURL = 'https://pbs.twimg.com/profile_images/1707398013398974464/lu87Drbo_400x400.jpg';
- let playerImage = new Image();
- playerImage.src = imageURL;
- playerImage.onload = function() {
- console.log('Player image loaded successfully');
- };
- let lastDirection = 'right';
- function overridePlayerDraw() {
- if (typeof player !== 'undefined' && typeof player.draw === 'function') {
- player.draw = function() {
- if (this.xmove > 0) {
- lastDirection = 'right';
- } else if (this.xmove < 0) {
- lastDirection = 'left';
- }
- ctx.save();
- if (lastDirection === 'left') {
- ctx.scale(-1, 1);
- ctx.drawImage(playerImage, -(this.x + this.w), this.y, this.w, this.h);
- } else {
- ctx.drawImage(playerImage, this.x, this.y, this.w, this.h);
- }
- ctx.restore();
- };
- } else {
- setTimeout(overridePlayerDraw, 100);
- }
- }
- overridePlayerDraw();
- })();