danpost wrote...
This should simplify things a bit more. Replace lines 18 through 94 with the following:
if (pasos == valor[j])
{
String[] colors = { "azul", "cyan", "amarillo", "verde", "rojo" };
if ("Left".equals(direction)) turn(-90); else turn(90);
String suffix = getRotation() == 180 ? "left" : "";
setImage("camion"+colors[numruta-1]+suffix+".png";
pasos = 0;
progreso++;
j++;
}
