News for hackers. Stuff that matters.
Re:Show HN: Untrusted, a JavaScript adventure game you play ... by th0br0 on Monday April 07, 2014 @02:03PM (#7548152)
You should reinit the map though, otherwise doing this on level 2 causes funny bugs (and makes the game rather easy ;)

    maze.create = function() {};
    var tmp = map.placeObject;
    map.placeObject = function(x, y, t) {
    	if(t == 'exit') tmp(x,y,t);
    };
Re:Show HN: Untrusted, a JavaScript adventure game you play ... by alnis on Monday April 07, 2014 @02:26PM (#7548291)
If you reload the game, the map should now re-init on every level.

PS. I'm really enjoying all the creative solutions you guys are coming up with!

Re:Show HN: Untrusted, a JavaScript adventure game you play ... by untitaker_ on Monday April 07, 2014 @02:11PM (#7548193)
level 2 can be solved by using the two "unlocked" lines to comment out the whole maze.create call, too.
Re:Show HN: Untrusted, a JavaScript adventure game you play ... by zenojevski on Monday April 07, 2014 @06:13PM (#7549953)
Related: things like these do not work, because of implementation.

    if (false) // <- inserted by me
    for (var ...) { // <- existing code
        ...code...
    }
Too bad, because extra `for`s could be fun...
Re:Show HN: Untrusted, a JavaScript adventure game you play ... by maaaats on Monday April 07, 2014 @02:39PM (#7548398)
That's kinda the point, though. Read the comments for that file. ;)
Re:Show HN: Untrusted, a JavaScript adventure game you play ... by randunel on Monday April 07, 2014 @03:30PM (#7548773)
you don't need 2 lines, you only need the one below to overwrite the map function, and leave an open dot :D

map.placeObject(7,4,'exit');var a = {map: {placeObject:function(){}}};a.

Re:Show HN: Untrusted, a JavaScript adventure game you play ... by mt3ck on Monday April 07, 2014 @03:07PM (#7548600)
thanks for the help ;)