An issue: It was also possible to pass with just self.moveXY(44,22)
This causes Tharin to walk to the right, but not as far as the right cross. Then the fireballs keep firing from the same positions for the whole duration and never hit. I don’t think there are any blind spots between the crosses (that avoid fireballs on both sides) but the issue is that the checkpoint does not change while standing between crosses.
Edit: increasing the cpTolerance probably won’t help but maybe there could be something that prevents the same emitters from firing too many times in a row.
I’m assuming moveXY is allowed for this level since it’s in the forest.
This is a frustrating problem for higher speed characters. For the record, it can be done with the ring of speed and my normal boots equipped (Anya). I’d recommend adding the following hint to the level description, however: “Note: If your character is a fast runner, you might need to adjust the target you are running towards on each side in order to stay safe.”
I tried an alternative solution but the fireballs were not showing up with either findMissle command. I’m not quite sure why that was. One possible hint as to why that is not working is that the fireballs are not selectable when the game is paused. If at all possible, designate the fireballs as missles so that other solutions are possible.
I can verify that Zuf’s solution still works.
Just moving to (37, 22) and/or (37,27) works too. The fireballs pass harmlessly on either side.
Coding suggestion/concept:
a.Set up 3 functions which test if the character is in a region (left, right, center). The regions should overlap slightly so the stand in the middle trick doesn’t work.
b. If there is a gem to the left and the player is not in the right region after a pause of __,
generate a fireball using the player’s x coordinate and a center fireball.
If player is in right region, generate center and left fireballs. Once they are fired and a pause of __, remove gem.
c. If there is a gem to the right and the player is not in the left region after a pause of __,
generate a fireball using the player’s x coordinate and a center fireball.
If player is in left region, generate center and right fireballs. Once they are fired and after a pause of __, remove gem.
d. If there is no gem and the player is not in the center, just generate one fireball using the player’s current x coordinate. (If the player is moving, they should be safe as by the time the fireball gets there, they won’t be there anymore … ).
I was able to beat it, although I had to unequip the speed ring. Can it just be restricted for the level? Seems like the easiest fix. Otherwise, running the fireballs and gem appearance based on time would work too, as the player should stay on the correct spot as long as the gem is present (or missing).
In other news, building a fence does not stop fireballs from killing you…
I went through and adjusted the Forest Fire Dancing level so the firebolts adjust their speed based on the hero’s speed, so no matter which hero and items you use, you should be able to beat it!
I also implemented a fix for the unintended solution.
Forest Fire Dancing is meant to be an introduction to nested if loops, so the solution is meant to be easy.
Thanks everyone for your feedback! Feel free to test it again and tell us if you see anything wrong.
Thanks for this - This answer solved it for me
the mark where the gem was supposed to stop on the right was x = 45 but it actually stops on x = 46 so if you’re coding for 45 it’s never true that it is 'on the right’
I racked my brains for some time as I was sure my code was correct - and it was!! The marker in the picture should have been under the stone.
Once I changed it to x = 46 (where the gem actually sat) it ran properly
I have problem with: Line 2: evilstone is not defined. What? in my line 2 is " while (true) {
while (true) {
evilstone = this.findNearestItem();
if (evilstone) {
pos = evilstone.pos;
if (pos.x == 34) {
// If the evilstone is on the left, go to the right side.
this.moveXY(46, 22);
} else {
// If the evilstone is on the right, go to the left side.
this.moveXY(34, 22);
}
} else {
// If there’s no evilstone, go to the middle.
this.moveXY(40, 22);
}
}