So, I am confused on how to set the varibale advance to work. Can I get some help. I am using Python, Here is my code:
# Advance through the forgotten tomb.
# Be wary, traps lay in wait to ruin your day!
# The Paladins volunteer to lead the way.
# Command them to shield against incoming projectiles.
while True:
friends = hero.findFriends()
# findEnemyMissiles finds all dangerous projectiles.
projectiles = hero.findEnemyMissiles()
for friend in friends:
if friend.type is "paladin":
# Find the projectile nearest to the friend:
nearest = hero.findNearest(projectile)
# If the projectile exists
# AND is closer than 10 meters to the paladin:
if projectile and paladin:
# Command the friend to "shield":
hero.command(paladin, "sheild", hero)
# ELSE, when there is no potential danger:
else:
# Advance the paladin:
pass
else:
# If not a paladin, just advance:
pass
# Advance the hero in the x direction:
# Advance through the forgotten tomb.
# Be wary, traps lay in wait to ruin your day!
# The Paladins volunteer to lead the way.
# Command them to shield against incoming projectiles.
while True:
friends = hero.findFriends()
# findEnemyMissiles finds all dangerous projectiles.
projectiles = hero.findEnemyMissiles()
for friend in friends:
if friend.type is "paladin":
# Find the projectile nearest to the friend:
nearest = hero.findNearest(projectile)
# If the projectile exists
# AND is closer than 10 meters to the paladin:
if projectile and friend:
# Command the friend to "shield":
hero.command(friend, "sheild", hero)
# ELSE, when there is no potential danger:
else:
# Advance the paladin:
newX = hero.pos.x + 10
newY = hero.pos.y
hero.moveXY(newX, newY)
pass
else:
# If not a paladin, just advance:
newX = hero.pos.x + 10
newY = hero.pos.y
hero.moveXY(newX, newY)
pass
# Advance the hero in the x direction:
newX = hero.pos.x + 10
newY = hero.pos.y
hero.moveXY(newX, newY)