Broken Circle: Please Help!

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():
        angle -= 0.0004
        angle - 1

Hey @Alba_Fernandez_Serna were you able to completed the level? I’m confused… Thx
@Deadpool198 My code is below

// 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!

His last post is Aug 31, 2017 his probably not active anymore can you post a link of the level?

How do i do that, just a http link? like this? @weary

Starting of hints:
Use vectors (towards the center)
Use hero.isPathClear()
Read this topic: Sir Robin Bravely Ran Away - looked for a more elegant answer and received a class in using Vector

Obviously there are lots of ways you could do this level so don’t just stick to this, but that’s how I did it.

1 Like

I think your link got an error. I’m not seeing any part of the level. Is this what you saw? @Deadpool198

Yes that’s the right level.

1 Like

Oh Ok My bad sorry :worried:

Don’t worry. Try doing what I said, then post your code again.

Just still not working I’m still struggling

Well it’s been three weeks of struggle and still nothing. You’re my last hope @Deadpool198

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.

Ok. At the moment I can’t access coco for some reason. I’ll send when I can @Deadpool198

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.

can someone please help me this is my code
Edit: the code was working i just needed to submit a few times

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.