Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

How to beat Crossroads

while True:
    hero.buildXY("fence", 55, 35)
    hero.buildXY("fence", 40, 50)
    hero.buildXY("fence", 25, 35)
    hero.buildXY("fence", 40, 20)

is my currant code

hey try following instructions first before changing your code completely

1 Like

and also

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!

1 Like

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!

You have to check if where the enemy’s position is. If the enemy’s position x is greater than yours, build a fire-trap at the right X mark. If the enemy’s position x is less than your hero’s position x, you would build frie-trap on the left X mark. If the enemy’s position y is greater than your hero’s position y, then build a fire-trap at the top X mark. If the enemy’s position y is less than your hero’s position y, then you have to build a fire-trap at the bottom X mark. Then, you would need to move back to the center, so you don’t get blown up by the explosion.

1 Like