It was not immediately obvious that I had to be standing close to the archer in order to report the number. There is a cross, but it wasn’t mentioned explicitly.
It’s also possible to get away with not collecting any coins and reporting 0 afterwards. Was that intentional?
Goal failure if Naria dies: works.
There was also this from the first submission seed:
Saying NaN didn’t work either. This issue didn’t happen on any of my other submissions.
Edit: the code from the editor shows that Naria is supposed to say “Eh? Come closer if you’re talking to me!” if the speaker is too far away, but that never happened.
The method I used, which also appears in the guide, is to use a break:
while(true) {
// do things
if(this.now() >= 30) {
break;
}
}
For some reason, while(this.now()<30) results in an infinite loop but the above method doesn’t. It happens in other levels too. I remember encountering this when I wanted to shield for the first x seconds of a level.
I think people are more likely to try this first (like I did) because it seems more intuitive. Then they get stumped by the infinite loop. The guide, at least, shows a workaround, but could we get an explanation for why the more obvious approach doesn’t work?
There is a hidden patch affecting the way the game engine interprets your code: a basic game frame is advanced in the main loop if time was not advanced. Basically
loop {
...
}
is equivalent to:
while (true) {
.....
if no_wait_or_time_taking_hero_actions_performend
this.wait(one_game_frame);
}
So a loop may work but a while(true) will fail.
This protection is implemented to help beginners and it may not be activated on all levels.
Basically your code was bad all the time, but the compiler “fixed” it.
@AdrianCgw is right except both loop: and while True: wait one frame before updating (while true was added due to it being the favored code loop code for courses)
while not False:
while 1 is 1:
while self.now() < 30:
while (anything but the word: True):
will update as fast as it can, which can lead to the max process being hit, as computers can do things really fast.
There is a forum post either here or on GitHub about this. I would link to it, but I can’t find it.
if you use enemy.health to see if an enemy has died, it says i need this.health. but this. health tracks my health not the enemy’s health. It just won’t let me continue.