SheeEttin
Re:Show HN: Untrusted, a JavaScript adventure game you play by modifyi...
on Tuesday April 08, 2014 @07:25PM (#7556704)
Well you can play it that way too, if you want. Try overriding some of the internal functions using creative methods. :)
Re:Show HN: Untrusted, a JavaScript adventure game you play by modifyi...
on Tuesday April 08, 2014 @07:20PM (#7556677)
We've also been discussing it over on reddit: http://www.reddit.com/r/webdev/comments/22gxx1/untrusted_a_j...
Re:Show HN: Untrusted, a JavaScript adventure game you play by modifyi...
on Tuesday April 08, 2014 @07:20PM (#7556671)
Ooh, shift, nice. Didn't know about that. That should come in handy.
Re:Show HN: Untrusted, a JavaScript adventure game you play by modifyi...
on Tuesday April 08, 2014 @12:42PM (#7554500)
I'm trying with
player.killedBy(function(){throw new Exception();});
...but then that just means I get killed by "function(){throw new Exception();}".Edit: never mind, got it. Overriding onCollision helps. :)
Re:Show HN: Untrusted, a JavaScript adventure game you play by modifyi...
on Tuesday April 08, 2014 @12:21PM (#7554350)
I wish we could retrieve the solution we used for past levels. :(
Okay, I think I've replicated it. I just overrode onCollision with empty braces, so the final definition looked like this:
map.defineObject('attackDrone', {
'type': 'dynamic',
'symbol': 'd',
'color': 'red',
'onCollision': function (player) {
player.killedBy('an attack drone');
},
'behavior': function (me) {
},
'onCollision': function (player) {
}
});
Note that you're closing the game's braces, inserting another definition, then re-opening braces to match the game's closing ones.
Re:Show HN: Untrusted, a JavaScript adventure game you play by modifyi...
on Tuesday April 08, 2014 @12:14PM (#7554298)
https://gist.github.com/anonymous/12b15e3de9340655ed78
Variable to control the direction the robot moves, changed with the function phone.
Re:Show HN: Untrusted, a JavaScript adventure game you play by modifyi...
on Tuesday April 08, 2014 @11:23AM (#7553931)
A good solution would be to remove an invalid item, and the function should silently try to remove the invalid item, but still allow passage. For some reason, even when you have the green key, but try to remove an invalid item, it still doesn't let you through, despite apparently returning false (passable).
Additionally it doesn't support injection there, so while "player.removeItem('greenKey'); player.additem('greenKey');" should work, it says "TypeError: undefined is not a function".
Re:Show HN: Untrusted, a JavaScript adventure game you play by modifyi...
on Tuesday April 08, 2014 @11:13AM (#7553889)
Of course. I made them harmless and walked right through them.