Armax / Pokemon-GO-node-api

Pokemon GO api node.js library
MIT License
875 stars 198 forks source link

Change detection-radius #103

Closed reecube closed 8 years ago

reecube commented 8 years ago

Is there a way to change the radius of the wild pokemons?

bcbrian commented 8 years ago

To do that I just loop the heartbeat with increments to the location by 0.0025... I looked at how @AHAAAAAAA did it in his python version.

...
var delta = 0.0025;
    var x2 = x-2*delta;
    var y2 = y-2*delta;
    var coords = [];
    for (var i = 0; i < 4; i++) {
      for (var j = 0; j < 4; j++) {
        coords.push([
          y2+i*delta, x2+j*delta
        ])
      }
    }
    var pokemonList = [];
    console.log("DOING THIS WITH: ", y, x);
    console.log("COORDS: ", coords);
    coords.forEach((coord, index)=>{
...

Then in side this function I push all the pokemon and return those upon completion

reecube commented 8 years ago

Thanks a lot!