Skip to content

Instantly share code, notes, and snippets.

@10maurycy10
Last active November 4, 2021 17:23
Show Gist options
  • Save 10maurycy10/d2f14357c7e6ae477d092bcafaa3476b to your computer and use it in GitHub Desktop.
Save 10maurycy10/d2f14357c7e6ae477d092bcafaa3476b to your computer and use it in GitHub Desktop.
clean up darrows map
save = 'PUT YOUR MAP HERE'//replace contence of string with map
save = JSON.parse(save)
for (i in save.obstacles) {
save.obstacles[i].width = Math.round(save.obstacles[i].width/100)*100
save.obstacles[i].height = Math.round(save.obstacles[i].height/100)*100
save.obstacles[i].x = Math.round(save.obstacles[i].x/100)*100
save.obstacles[i].y = Math.round(save.obstacles[i].y/100)*100
}
console.log(JSON.stringify(save))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment