Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

Stillness in Motion


#1

I need the code answers for CS2 Stillness in Motion


#2

We do not give out code in this board as it interferes with learning. Please post your code correctly and we’ll be more than happy to help from there.


#3
while True:
    enemy = hero.findNearestEnemy()
    # If there is an enemy, then...
    if enemy:
        # Create a distance variable with distanceTo.
        
        # If the distance is less than 5 meters, then attack.
        
        # Else (the enemy is far away), then shield.
        
        pass
    # Else (there is no enemy)...
    else:
        # ... then move back to the X.
        hero.moveXY(40, 34)


#4

you haven’t even tried to complete the code?! we can’t help you until you try.