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

Coordinated Defense #152

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

# Protect the peasants from the ogres.

while True:
    # Get an array of enemies.
    enemies = hero.findEnemies()
    # If the array is not empty.
    if len(enemies) > 0:
        # Attack the first enemy from "enemies" array.
        hero.attack(enemies[0])
        # Return to the start position.
        hero.moveXY(40,20)
        pass