Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

Stranded in the Dunes


Every time I get to the next screen my hero run to the edge of the screen, how to solve it?

while (true) {
    var flag = hero.findFlag();
    if(flag) {
        hero.moveXY(flag.pos.x, flag.pos.y);
    var enemy = hero.findNearestEnemy();


I had the same exact problem and the solution is very silly. When you place your flag at the edge of the screen you have to make sure the entire x, y is on the current screen (use the shadow circle at the flags base). If you place the flag over the edge it places a flag on the very edge of the next screen and your hero will walk across the entire map before breaking the moveXY.

I hope I explained that well. Good luck!