Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

HELP Circle Walking

I don’t get errors but it doesn’t work I don’t know why

# Mirror your partner's movement around the center X mark.
# Vectors can be thought of as an x, y position
# Vectors can also represent the distance and direction between two positions

# use Vector.subtract(vector1, vector2) to find the direction and distance from vector2 to vector1
# use Vector.add(vector1, vector2) to find the position you get when you start from vector1 and follow vector2
partner = hero.findByType("peasant")[0]
Vector.subtract(partner.pos, hero.pos)
Vector.add(hero.pos, partner.pos)
# Create a new Vector at the center X point
center = Vector(40, 34)

# A unit's position is actually a Vector!
partner = hero.findByType("peasant")[0]

while True:
    # First, you want to find the Vector (distance and direction) of the partner's position to the center X.
    #vector = 
    vector = Vector.subtract(partner.pos, center) 
    
    # Second, find the position your hero should moveTo starting from center, and following vector.
    #moveToPos = 
    moveToPos = Vector.subtract(center, vector) 
    # Third, move to the moveToPos position.
    hero.moveXY(moveToPos.x, moveToPos.y)
    pass

someone help me please

Other than having a couple of unused/unneeded Vector lines, the code looks good. It runs successfully and even Submits fine, for me.

Thats weird, im goint to try changing my boots

Solved it! it was my boots lmao

1 Like

Good idea…I have Leaping and Speed equipped.