[SOLVED] Twisted Canyon - ruins

Hi Guys :slight_smile:

I got problem how to move next to ruins, how to attack them?

Please help :slight_smile:

I had a look, but my map differs much from one on your screenshot. Nothing like ruins)

If you are not trying to get the maximum coins, move back to your start point (the first red dot) and then navigate up and over to the X on the right of the map. Once you touch touch the X, the game ends.

Like Alexbrand, the map I had was much differentā€¦I think this is normal and to be expected.

Also, based on your screenshot, it appears that no other coins are obtainableā€¦the ones to the left of the X cannot be taken, because you would have to step on the X to get to them.

hi, thx for answer , I got a question, how to navigate( is there a special method) my hero to X point?

thx . :slight_smile:

Hi @Zambi25, Welcome to the CodeCombat discourse.
I think you can navigate your way to the white X, without going past the ruins. In my seed (my version of the level), you can walk to places where it seems there are rocks, but in fact you can walk over them.
Iā€™m not sure about this as I canā€™t play your level, but if you look at this screenshot :arrow_down: you will see that I walk to places which appear to be in the middle of the rocks. Maybe you can walk up to the X continuing going diagonally through some of the rocks. if you see what I mean.
Screen Shot 2020-01-19 at 13.06.33
Maybe you still canā€™t, Iā€™m not sureā€¦ Have you tried reloading your code, then reloading the level to get a different seed?

1 Like

Anyone can help me,? I ve still got a problem to past this level

I tried reloading my code, then reloading the level and got a same seed

Maybe is some of bug?? Please help me

There is no way to move diagonally here because of level equipment limitations. But try hero.moveLeft(2) from (44, 38). Maybe that was meant as creativity in level describe, idk) Coins in this level are like bread crumbs, they lead you to right path.

I had to change browser and log out of account to get to this version of lvl map. But itā€™s possible to complete. There is no bug. Though, I donā€™t understand the purpose of such level design :roll_eyes: :hushed: :thinking:

1 Like

Success, I past this level , there was a crossing through the rocks

thx for help

1 Like

Well done Zambi25! I wish I had known you could walk thru some of the obstacles when I played this levelā€¦I passed it without, but would have been more satisfying to grab as much loot as possible :wink:

So, you can replay it)

I get maximum coins :wink:

1 Like

I just solved a version of Twisted Canyon I donā€™t see above. In my version I can defeat the three enemies with a while loop which runs three times before our hero comes to the X mark.
the while loop starts after hero moveLeft to reach the first of the three enemies:

while(true) {

var enemy = hero.findNearestEnemy();
    hero.attack(enemy);
    hero.moveUp(2);
    hero.moveDown(2);
    hero.moveRight(2);
    hero.moveUp();
    hero.moveRight();
    hero.moveUp();
    hero.moveLeft();

}

the last line ā€œhero.moveLeft();ā€ makes the hero walk left when coming to the x-mark, but the line is needed to defeat the three enemies. I was thinking about an if statement like:

  if (hero postion != x:68, y:62) { 

      hero.moveLeft();
      }

Do anyone have an idea how to solve it? I am complete beginner. Just if you know how to use coordinates in a if statement.

Howdy and welcome to the forum!

To speak to your opening comment, everyone gets a different starting ā€˜seedā€™, so it is quite rare when 2 playerā€™s match maps. Mine is quite a bit different from what you are showing.

Another point, tho you might already know this, but just in case: some walls are illusions and can be walked through.

So, there are several different ways to do the if coordinates statement. ā€˜hero.posā€™ is actually the vector of the heroā€™s position. If you had your hero say it, it would look like ā€œ{x: 68, y: 62, z: 1}ā€. To keep it simple, try this method instead:

if (hero.pos.x != 68 && hero.pos.y != 62) {
    hero.moveLeft();
}

I tested the code but it didnā€™t work, I checked and I got some odd code warning on the first line //commentā€¦ I checked and I am in Python for this particular practise. I canā€™t change it back but I was in Javascript when I started. Perhaps a bug, I will log off and in tomorrow to see again. But thanks for replying, I am sure it will work.

If you switched languages, understand that your code will not be auto-converted. It will remain the original language and you will have to convert it.

// is the code for commenting in JS
# is the code for commenting in PY

I did not switch language. Always in Javascript and that is what I coded in until I wanted to solve the problem you helped me with. When I returned to enter the code, it was in Python. Moving back to Kithgard Dungeon, the rest of the practise levels are still in Javascript. Only Twisted Canyon changes to Python. A known bug?

Wowā€¦first Iā€™ve heard of this happening, automatically. However, besides changing the language via the Game Menu, you can also specify the language via the link, like this:

https://codecombat.com/play/level/twisted-canyon?codeLanguage=javascript

So, if you encounter such a switch again, use the ā€˜codeLanguageā€™ switch to change it back. It works for all supported coding languages.

That link you sent me worked.

I added the the line of code and it worked like a charmā€¦ I mean gem.

I have another issue in the program that was discussed a year ago. It is the last practise level in the Game Develop 1:

In Tabula Raza:

//Gems
game.addCollectGoal(5);
game.spawnXY(ā€œgemā€, 68, 23);
game.spawnXY(ā€œgemā€, 60, 23);
game.spawnXY(ā€œgemā€, 52, 23);
game.spawnXY(ā€œgemā€, 52, 14);
game.spawnXY(ā€œgemā€, 52, 10);

//Trackers
ui.track(game, ā€œcollectedā€);

I can collect the gems but they donā€™t appear in the ui display as Collected (there is a ā€œ0ā€ but not counting).

I was in the forum and they had this problem one year ago and I seem to have the same problem. Is there a solution. The collect gem code works fine in practise level ā€œ5. Gemactularā€:

// Add a goal to collect the gems using game.addCollectGoal()
game.addCollectGoal(10);

// Spawn 3 gems across the level for the player to collect:
game.spawnXY(ā€œgemā€, 28, 28);
game.spawnXY(ā€œgemā€, 28, 10);
game.spawnXY(ā€œgemā€, 64, 10);
game.spawnXY(ā€œgemā€, 64, 28);
game.spawnXY(ā€œgemā€, 58, 52);
game.spawnXY(ā€œgemā€, 44, 44);
game.spawnXY(ā€œgemā€, 58, 52);
game.spawnXY(ā€œgemā€, 28, 59);
game.spawnXY(ā€œgemā€, 28, 44);
game.spawnXY(ā€œgemā€, 19, 44);

Why is it a difference here? I promised to post your answr in the forum for people who wonder the same.

Kind regards
Ɩrjan