Back to front pageView on Hacker News (opens in a new tab)Show HN: Untrusted, a JavaScript adventure game you play by modifying its source (opens in a new tab)alex.nisnevich.com555 pointsby alnis (on Hacker News)12 years agoComments (235) 72 threadsShow all commentsShowing thread 56 of 72[-]epsylon12 years ago1 reply#Is there any solution to the ambush level other than the obvious solution of moving the drones out of the way?[-]SheeEttin12 years ago1 reply#Of course. I made them harmless and walked right through them.[-]epsylon12 years ago1 reply#Tried that, but for some reason I couldn't disable the onCollision by assigning it to some dummy function. Do you mind sharing your solution?SheeEttin12 years ago#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.
Show HN: Untrusted, a JavaScript adventure game you play by modifying its source (opens in a new tab)alex.nisnevich.com555 pointsby alnis (on Hacker News)12 years ago
epsylon12 years ago1 reply#Is there any solution to the ambush level other than the obvious solution of moving the drones out of the way?
epsylon12 years ago1 reply#Tried that, but for some reason I couldn't disable the onCollision by assigning it to some dummy function. Do you mind sharing your solution?
SheeEttin12 years ago#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.
Comments (235) 72 threads
Show all comments
Showing thread 56 of 72
Okay, I think I've replicated it. I just overrode onCollision with empty braces, so the final definition looked like this:
Note that you're closing the game's braces, inserting another definition, then re-opening braces to match the game's closing ones.