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.
She try to do that :
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.
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.