Ah, it does require the hammer, but it fails to restrict the weapons, so the requirement doesnât work. It still wonât restrict a super high level weapon, but it should at least restrict basic weapons now.
Fences are free, since we didnât want to make gold management be a thing during all the early fence levels. I guess that works⊠but you canât get the bonus goal that way.
Iâm not seeing the infinite loop with that code, which should be pretty fast; are you sure itâs an infinite loop and not some other sort of error that might show up in the JS console?
That was (and is just now) on my windows 8 machine, maybe it was downloading updates or something back then.
The slow/inf-loop error is the bane of my codecombat existence. It loves to follow me around. (I can get it with move() I can get it with moveXY() . . . I am just that goodâŠ)
(picture below) completed the level with 60 coins and wasnât awarded the bonus (for collecting 60 coins). Attempted it again where I collect 61 before I run back and it worked that time (although Iâm not sure if that means that was the issue).
One of my attempts only spawned 59 coins total
I received an âinfinite loopâ error, so it commented out my code. Removed the comment and it ran fine.
The problem of missing hammer or boots requirement before starting a level is very common.
Same problem with hammer for level treasure cave I think. We need to build fire trap but hammer not required.
Maybe there is problem in the test process before publishing a level, or in the way it is required which not safe enough.
Edit : I also got an infinite loop when the hero try to pass the fence. Sheâs stopped against the wall, and then : infinite loop detected. Even If I did not reach the x<16. Same with moveXY or move.
On levels where the hammer is, um, nice. but not REQUIRED it make sense to allow higher weapons for later, but for some levels this is not a matter of bonus but of actual completionâŠ
It seems that Ogre Gorge Gouger requires you to build a fence. (I donât have a strong enough weapon to kill all the ogres before time runs out so I donât know for 100% sure that the fence is requiredâŠ)
Treasure cave requires that you lure the yeti, and it appears that the only way to do that is with the boom of a fire-trap. (I tried running around and leading him to the spot, but that doesnât count as âlureâ)
If there is a later âTrap Beltâ that does fences and fire-traps, well then, there we are.
For the infinite loop, the problem is worse. I tried to avoid the fence, targetting the entry, but then Iâm blocked in the middle to reach the fence:
(same code than above, just the target change this.move({x:23 ,y: 38});). And it make my chrome tab crash.
@Nick, as said in my last post, not sure itâs because Anya was blocked. In the last picture, she was not blocked at all. It seems more random, or maybe linked to enemy arrival.
to make it enter in the infinite loop. The position is not behind the fence, so nothingâs blocking.
BUT, if I change the code like this, itâs working:
I just change the target x-1. So maybe the move detect that the position is reached and do not go farther, but the this.pos.x is not updated and the value is still 24. So infinite loop. A wrong rounding somewhere ?
I have fixed it to not infinitely loop when you are moving towards a place that youâre already at (or very, very close to) inside a while loop. Let me know how that goes.
Not sure whether whether you need to move slightly past your target, since the move will determine itâs close enough if itâs within 0.1m, and you might end up at, say, this.pos.x == 23.000023519. But at least it wonât infinitely loop any more.