Anti Screen Movement

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

当前为 2021-05-16 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Anti Screen Movement
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  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. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13. setTimeout(function(){
  14. function a57(event) {
  15. relPos = c2.getRelPos(RD.pool[c3].getAttr())
  16. , relPosX = relPos.x * j6
  17. , relPosY = relPos.y * j5
  18. , mouseAngle = Math.atan2(relPosY - event.clientY, relPosX - event.clientX) * 180 / Math.PI + 180
  19. , playerAngle = Math.round(mouseAngle + Math.asin(18 / Math.sqrt(Math.pow(relPosX - event.clientX, 2) + Math.pow(relPosY - event.clientY, 2))) * 180 / Math.PI)
  20. , console.log(mouseAngle, playerAngle);
  21. //j39 = Math.sqrt(Math.pow(relPosY - event.clientY, 2) + Math.pow(relPosX - event.clientX, 2)),
  22. j16 = [Math.round(relPosX - event.clientX), Math.round(relPosY - event.clientY), Math.round(mouseAngle)],
  23. /*
  24. RD.pool[c3].mouseAngle = Math.round(mouseAngle);
  25. if (playerAngle > 360)
  26. playerAngle = playerAngle - 360;
  27. else
  28. !playerAngle && (playerAngle = mouseAngle);
  29. */
  30. RD.pool[c3].playerAngle = playerAngle;
  31. };
  32. addJS_Node (a57);
  33.  
  34.  
  35. RD.prototype.applyPrimaryUpdate = function(idk) {
  36. if (!this['activated'])
  37. return;
  38. this.x = parseFloat(idk.x / 10),
  39. this.y = parseFloat(idk.y / 10),
  40. idk['id'] != c3 && (this['playerAngle'] = parseInt(idk[_0x2b6237(0x36f)]));
  41. }
  42. }, 1000)
  43.  
  44.  
  45. function addJS_Node (text, s_URL, funcToRun, runOnLoad) { //copie + paste from stackoverflow :)
  46. var D = document;
  47. var scriptNode = D.createElement ('script');
  48. if (runOnLoad) {
  49. scriptNode.addEventListener ("load", runOnLoad, false);
  50. }
  51. scriptNode.type = "text/javascript";
  52. if (text) scriptNode.textContent = text;
  53. if (s_URL) scriptNode.src = s_URL;
  54. if (funcToRun) scriptNode.textContent = '(' + funcToRun.toString() + ')()';
  55.  
  56. var targ = D.getElementsByTagName ('head')[0] || D.body || D.documentElement;
  57. targ.appendChild (scriptNode);
  58. }
  59.  
  60. })();