Show HN: Untrusted, a JavaScript adventure game you play by modifying its source
1–10 of 246 posts
Re: Show HN: Untrusted, a JavaScript adventure game you play by modifying its source
#2You had me at "The continuing adventures of Dr. Eval"
Re: Show HN: Untrusted, a JavaScript adventure game you play by modifying its source
#3I really like that it has WASD/Arrow/Vim controls. Props.
Re: Show HN: Untrusted, a JavaScript adventure game you play by modifying its source
#4Content note: plays sound.
Did the quick ^W at work :|
Re: Show HN: Untrusted, a JavaScript adventure game you play by modifying its source
#5You 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 modifying its source
#6I broke level 4. Is there an obvious way that I am missing to reset at the level you're on when the reset functionality provided under the text editor is insufficient?
Re: Show HN: Untrusted, a JavaScript adventure game you play by modifying its source
#7This music is awesome. What genre is it?
Re: Show HN: Untrusted, a JavaScript adventure game you play by modifying its source
#8You 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); };
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 modifying its source
#9I broke level 4. Is there an obvious way that I am missing to reset at the level you're on when the reset functionality provided under the text editor is insufficient?
The Reset button should completely reset editor state for the level. What happened?
Re: Show HN: Untrusted, a JavaScript adventure game you play by modifying its source
#10This worked for the whole first chapter for me (and has some obvious further applications):
startLevel["constructor"]("m",
"console.log(m);" +
"var old = m.placeObject;\n" +
"m.placeObject = function(x,y,t) { \n" +
"console.log(t);\n" +
"if (t === 'exit' || t === 'computer') {\n" +
"console.log('adding' + t);\n" +
"return old['ca' + 'll'](m, x,y,t) }};")(map);
EDIT: I wonder if you could wrap the user's code in, e.g. https://code.google.com/p/es-lab/wiki/SecureEcmaScript, and use this to gamify finding bugs in that sandbox :-)