Skip to content

Latest commit

 

History

History
25 lines (19 loc) · 436 Bytes

17_pointers.md

File metadata and controls

25 lines (19 loc) · 436 Bytes

Jhack (giacgbj)

Connect the first teleport on the player's right to the one on the exit's right.

var start;
var end;
for (j = 0; j < teleportersAndTraps.length; j++) {
var t = teleportersAndTraps[j];
    var x = t.getX();
    var y = t.getY();

    if (7 == x && 4 == y)
    {
    	start = t;
    } else if (map.getWidth()-8 == x && map.getHeight()-5 == y) {
    	end = t;
    }
}

start.setTarget(end);
break;