Hello, I was going back to extra levels that i never passed and I was wondering if anyone can help me with my problem.
Here’s my code:
while True: enemy = hero.findNearestEnemy() friend = hero.findNearestFriend() # Calculate x by adding friend.pos.x to enemy.pos.x # Then divide by 2. # Check the guide if you need more help! x = (friend.pos.x + enemy.pos.x) / 2 # Now do the same for y y = (friend.pos.y + enemy.pos.y) / 2 # Move to the x and y coordinates you calculated. x = ("tower".pos.x + peasant.pos.x) / 2 y = ("tower".pos.y + peasant.pos.y) / 2
Here’s a screenshot: