This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am frogglet on github. | |
* I am frogglet (https://keybase.io/frogglet) on keybase. | |
* I have a public key ASBuYBAtUDzULSt5n2B_X7ynA9jcJIPVIe7qZVCThWJqwAo | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// utility function to wait for x milliseconds using async/await | |
const wait = ms => new Promise(res => setTimeout(res, ms)); | |
let API_REMAINING = 60; // number of remaining API hits allowed | |
let API_RESET = 0; // unix epoch timestamp for when API_REMAINING will be reset | |
const queue = []; // queue of jobs to manage | |
// this is the main function that infinitely loops to process the queue | |
async function process_queue(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The only thing HSHG expects a collidable object to have is a getAABB() method that | |
// returns an object with two properties, min and max, that should both have a single | |
// array with two numbers as coordinates. For example, an object at 10, 10 and | |
// height/width of 100 would return { min: [10, 10], max: [110, 110] } | |
function Vertex(args /*x, y, radius*/){ | |
var argProp; | |
for(argProp in args){ | |
if(args.hasOwnProperty(argProp)){ |