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

[solved] 安息之云山峰 跳舞人生 过关总是提示失败,请指点

#1

friend = hero.findNearest(hero.findFriends())
x = friend.pos.x - hero.pos.x
y = friend.pos.y - hero.pos.y
while True:
heroX = hero.pos.x
heroY = hero.pos.y
if friend.pos.x - hero.pos.x > x:
heroX += friend.pos.x
if friend.pos.x - hero.pos.x < x:
heroX -= friend.pos.x
if friend.pos.y - hero.pos.y > y:
heroY += (friend.pos.y-y)
if friend.pos.y - hero.pos.y < y:
heroY -= (hero.pos.y + y)
hero.move({“x”:heroX, “y”:heroY})

0 Likes

#2

friend = hero.findNearest(hero.findFriends())
while True:
hero.move({“x”:friend.pos.x, “y”:friend.pos.y - 6});

0 Likes