Serpent Savings - code issue?

The yellow duck tells me there’s an error but does not show me which line it is on. Do you know what’s wrong?:

Because thats not how to dodge

1 Like

You need to indent all the if statements so that they are inside the for loop.

Does anyone know how I can dodge the wall?

I do. You should find the x or y coordinates of the wall and dodge from them if the distance to the x or y is less than 5 or something.

So as peter said above, first define your target pos, then find Hazards, Enemies, and Missiles, then dodge by mutiplying it:
danger = Vector.multiply(danger, 10)
hope helps

Does anyone know what the API’s are and how to use them? It talks about them in the comments at the beginning but it doesn’t actually teach you anything about them.

I don’t know API’s aren’t mentioned in the previous levels.

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