Gats.io - No Camera Movement

helps if you're used to other io games' fixed view

当前为 2024-10-31 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Gats.io - No Camera Movement
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.3
  5. // @description helps if you're used to other io games' fixed view
  6. // @author Nitrogem 35
  7. // @match https://gats.io/
  8. // @grant none
  9. // @run-at document-start
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. window.addEventListener ("load", onload);
  16.  
  17. function onload() {
  18. let processMessageTmp = processMessage;
  19. processMessage = function(event) {
  20. processMessageTmp(event);
  21. let decoded = new TextDecoder().decode(event.data);
  22. if (!decoded.includes("a,")) return;
  23. camera.update = function() {
  24. let player = Player.pool[selfId];
  25. if (camera.trackingId) {
  26. camera.x = player.x - hudXPosition;
  27. camera.y = player.y - hudYPosition;
  28. }
  29. }
  30. }
  31. }
  32. })();