How can I beat Dance off?


#1

Can someone please give me the code for dance off in python?
This is my code:

friends = self.findFriends()
friend = self.findNearest(self.findFriends())

loop:
friendpos = friend.pos
fx = friendpos.x
fy = friendpos.y
if self.now() < 6:
self.move({‘x’: fx, ‘y’: 37})
if self.now() < 14 and self.now() > 6:
self.move({‘x’: fx, ‘y’: fy + 6})
if self.now() >14:
self.move({‘x’: fx, ‘y’: fy + 6})


#2

You don’t need to sync anything to now(). Just calculate your y-offset from your partner, and then move to his position + this offset.