Editing Modding

From AAGRINDER wiki
Jump to navigationJump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 17: Line 17:
 
At the moment, AAGRINDER is played in a browser [[https://store.xkcd.com/products/citation-needed-sticker-pack citation needed]]. Firefox unfortunately doesn't allow you to modify the JavaScript you want to run manually it seems, but Chromium can do it using its developer console (F12). For privacy, it's better if you use [https://github.com/Eloston/ungoogled-chromium ungoogled-chromium] instead of normal Chromium though!
 
At the moment, AAGRINDER is played in a browser [[https://store.xkcd.com/products/citation-needed-sticker-pack citation needed]]. Firefox unfortunately doesn't allow you to modify the JavaScript you want to run manually it seems, but Chromium can do it using its developer console (F12). For privacy, it's better if you use [https://github.com/Eloston/ungoogled-chromium ungoogled-chromium] instead of normal Chromium though!
  
To disable gravity, you'll want to only process fall events when you want that. The code below is a replacement for the lines 300 through 307 of the GameLogic.js file that will reject fall events unless you hold the up button (w), except if you are in water.  
+
To disable gravity, you'll want to only process fall events when you want that. The code below is a replacement for the lines 300 through 3XX of the `GameLogic.js` file that will reject fall events unless you hold the up button (w), except if you are in water.  
  
    'f':(view, data)=>{
+
 
        const x = view.player.x;
+
(a [[ghost]] ate the code, or fyfy hasn't pasted it yet)
        const y = view.player.y;
 
        if (!data.j) { // do gravity if jump is held
 
            isThisWater = view.getBlock(x, y);
 
            isWater = isThisWater === 'w';
 
            if (!isWater) { // do gravity in water
 
                view.reject(); // don't gravity!
 
            }
 
        }
 
  
 
This is unfortunately '''not allowed''' on the main server.
 
This is unfortunately '''not allowed''' on the main server.

Please note that all contributions to AAGRINDER wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see AAGRINDER wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)