I saw something like that in a different polygonception forum which had been dead for years. Here is the threads link.
Edit: I have some new code to show. I think this will work except for the original error. Here it is
# You are on your own this time, I hope you have learned what you need from the previous fractal levels. Check the guide for help with what you need to do and with the math required for polygons.
# You need a function to convert degrees to radians. Multiply degrees by Math.PI / 180.
def degreesToRadians(degrees):
degrees * Math.PI / 180
# Your polygon function should have 3 inputs: start, end, and sides.
def polygonMaker(start, end, sides):
# Remember to make your polygon recursive, drawing extra polygons at every corner.
heroShouldStartHere = Vector.subtract(yak.pos, hero.pos)
full = Vector(start, end)
for side in sides:
i = 0
while i < len(sides):
nextMovement = Vector.add(start, side)
i += 1
i = 0
break
# To get the start and end position for each polygon, add startOffset and endOffset to the yak's position.
startOffset = Vector(-15, -15)
endOffset = Vector(15, -15)
yaks = hero.findByType("ice-yak")
for yak in yaks:
start = Vector.add(yak.pos, startOffset)
end = Vector.add(yak.pos, endOffset)
sides = yak.sides # You need to loop through all the yaks, drawing a polygon for each. Yaks are enemies.
polygonMaker(start, end, sides)