I need help with level 38 Sarven Road here is my code.
while True:
# If there’s an enemy, attack.
xPos = hero.pos.x
yPos = hero.pos.y
enemy = hero.findNearestEnemy()
if enemy:
hero.attack(enemy)
hero.attack(enemy)
hero.attack(enemy)
# Else, keep moving up and to the right.
else:
hero.pos.x + 3
hero.pos.y + 3
Ok here’s my code and the link. The name of the level is
Interception
while True:
enemy = hero.findNearestEnemy()
friend = hero.findNearest(hero.findFriends())
# Find the point between the enemy’s position and your friend’s position.
# Check the guide if you need more help!
x = (enemy.pos.x + friend.pos.x) / 2
y = (enemy.pos.y + friend.pos.y) / 2
hero.move({‘x’: x, ‘y’: y})
I’m not trying to accuse or anything but did you try reloading the page.
The same thing happened to me yesterday and I reloaded the page and it worked.
Hello and welcome to codecombat discourse! This is a cozy forum where you can share ideas, share fan art, get assistance for code, etc! Before you proceed, we hope that you review this topic, which shows all essentials of this board! Thanks!
When asking for help on one level then need help with another level please make another topic for the level ok? you didn't do anything wrong but it keeps the forum clean thanks.