Magma Mountain HELP

so i have a code, where it makes it so that i find the nearest item and go to the items position, bad part is, i die because i hit my own lava, any way to avoid this?
if you need code, i will PM you, (i dont want my code to be public, its pretty good)

if you want to know what idea my code is based off of, battle me

i just hate how most of my losses are because of luck

def findLava():
    lavaMap = hero.getLavaMap()
    for lava in lavaMap:
        nearestDist=9999
        nearestLava=""
        if hero.distanceTo(Vector(lava.x,lava.y))<nearestDist:
            nearestDist=hero.distanceTo(Vector(lava.x,lava.y))
            nearestLava=lava
        return Vector(nearestLava.x,nearestLava.y)


this is the function i use to find the nearest lava, yet i dont jump when i code to

…you put the nearestDist and nearestLava in the for loop so they keep getting reset -_-

Oh, also, I just realized something that I should’ve a while ago, the lava map is just 1s and 0s

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.