I’ve decided to bite the bullet and attempt the Lost Viking level in the forest. I’ve put my code in the spoiler below, but what happens is my character runs straight up into the nearest bomb. Any clue why she might be doing this?
Full Code Below
function moveSouth(){
if(steps % skip === 0){
sideSteps -= 2;
}else{
sideSteps--;
}
}
function moveNorth(){
if(steps % skip === 0){
sideSteps += 2;
}else{
sideSteps++;
}
}
// The maze is 35 steps along the X axis.
while(steps <= 35) {
// Take the next step:
hero.moveXY(steps * X_PACE_LENGTH, sideSteps * Y_PACE_LENGTH);
// Increment steps and sideSteps as appropriate, taking into account the special rules.
steps++;
if(steps % swap === 0){
nextSwap++;
}
if(nextSwap % 2 === 0){
moveSouth();
}else{
moveNorth();
}
if(sideSteps > slide){
sideSteps = 1;
}
if(sideSteps < 1){
sideSteps = slide;
}
}