AlexeySapsay / Python_solution_CodeCombat_2018

In that repository I will post my sollution for codecombat.com games for study Python
1 stars 0 forks source link

Dance-Off #192

Open AlexeySapsay opened 6 years ago

AlexeySapsay commented 6 years ago
# Follow me on youtube  channel Phy Tu
# Help with programming on Python, school math, physics
# https://www.youtube.com/channel/UCP5ycahCEZ24qmRRgNnko5Q

# Move in sync with your dance partner to impress Pender Spellbane.
while True:
    friend = hero.findNearest(hero.findFriends())
    #disntance=hero.distanceTo(friend)
    deltaX=friend.pos.x-hero.pos.x
    deltaY=friend.pos.y-hero.pos.y
    while True:
        goal={"x":friend.pos.x-deltaX,"y":friend.pos.y-deltaY}
        hero.move(goal)