Hi, Broken Circles is my last level in code combat, but i don’t know how to do, can you help me?.This is my code:
(Hola, Círculos Rotos es mi último nivel en code combat, pero no se que hacer, ¿podrían ayudarme?.Este es mi código:)
# Las constantes son útiles
trapAttackRange = 3;
radiusStep = 10;
center = {"x": 68, "y": 68};
# Vamos, vamos, ¡Vamos!
center = Vector(center.x, center.y)
angle = 0
while True:
way = Vector.subtract(hero.pos, center)
normal = Vector.normalize(way)
normal = Vector.rotate(normal, angle)
direction = Vector.multiply(normal, radiusStep*5 + trapAttackRange+2)
move = Vector.add(center, direction)
if hero.findHazards():
hero.move(move)
angle -= 0.0004
else:
hero.move(move)
angle - 1
// Collect the treasure.
// No flags.
// No summons.
// No jumps.
// No magic.
// Infringes will be punished.
// Useful constants.
var trapAttackRange = 3;
var radiusStep = 10;
var center = {x: 68, y: 68};
// Go, Go, GO!
Please could you post your new code.
I’m going to be honest with you – first time round i couldn’t do this. I tried it again recently with a *janky bit of code (involving hero.isPathClear() in multiple lines, as said by @J_F_B_M. There are probably much easier ways of doing it though, like with circles or something. But I’ll try and help you do it with my tactic if you don’t have one yet.
Danny
I’ve watched the video below on how to move in a circle. The only problem is that I have no angle. So I can’t really solve it. And in response to your previous post, I have no tactic in particular. @Deadpool198
Try looking back at The Geometry of Flowers for a reminder about moving in circles. You’ll have to do the same thing with making your own angle variable and incrementally increasing it.
I’m also trying to solve the level, at the moment isPathClear doesn’t seem to be working properly with my code. Ho hum, more thinking required.