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

Bash 'Em All #155

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

# Be careful with these ogres.
# They are special trained fat-free uber ogres and very strong.
# The keyword is fat-free.
while True:
    enemy=hero.findNearestEnemy()
    item=hero.findNearestItem()
    if enemy:
        if hero.isReady("bash"):
            hero.bash(enemy)
            hero.moveXY(40,34)            
    else:
        if item:
            hero.moveXY(item.pos.x,item.pos.y)
            hero.moveXY(40,34)