Live data from Hacker News

Show HN: Untrusted, a JavaScript adventure game you play by modifying its source

alex.nisnevich.com

191–200 of 246 posts

Re: Show HN: Untrusted, a JavaScript adventure game you play by modifying its source

#192

Here's an Iron Man inspired solution for the boss battle :) map.placeObject(map.getWidth()/2, 5, 'block'); //map.placeObject(map.getWidth()/2, 1, 'block'); var player = map.getPlayer(); map.defineObject('missile', { 'type': 'dynamic', 'symbol': '^', 'color': 'blue', 'interval': 100, 'projectile': true, 'behavior': function (me) { me.move('up'); } }); function jericho() { var i; for (i = 3; i

For the truly lazy, this was my approach:

    map.overrideKey('up', function() {
        if (map.countObjects('boss') > 0) {
            for (var x = 0; x 

Re: Show HN: Untrusted, a JavaScript adventure game you play by modifying its source

#193

Here's an Iron Man inspired solution for the boss battle :) map.placeObject(map.getWidth()/2, 5, 'block'); //map.placeObject(map.getWidth()/2, 1, 'block'); var player = map.getPlayer(); map.defineObject('missile', { 'type': 'dynamic', 'symbol': '^', 'color': 'blue', 'interval': 100, 'projectile': true, 'behavior': function (me) { me.move('up'); } }); function jericho() { var i; for (i = 3; i

For the truly lazy, this was my approach: map.overrideKey('up', function() { if (map.countObjects('boss') > 0) { for (var x = 0; x

Nice. Lacks drama though, where's the dash through the rain of bullets to recover the missile launcher? :D

Re: Show HN: Untrusted, a JavaScript adventure game you play by modifying its source

#195

Any tips on level 15? Once the player is killed what could I possibly do?

I actually figured something out with this which is weird, because I don't think it has to do with exceptions. I passed in a new object of an undeclared type and just walked across the water, which I can't explain. Can anyone help?

I think that's the purpose, the filename says something about "exception".

Re: Show HN: Untrusted, a JavaScript adventure game you play by modifying its source

#196

Is there any solution to the ambush level other than the obvious solution of moving the drones out of the way?

Of course. I made them harmless and walked right through them.

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?

Re: Show HN: Untrusted, a JavaScript adventure game you play by modifying its source

#197
post #150
post #82

:'( I'm stuck at crispsContest.js lvl

This level was driving me crazy (mostly because of the character limit). The solution that I found is kind of silly: it turns out the removeItem function is dumber than you probably think it is.

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 modifying its source

#198

Anybody think of another way to do the robot levels without adding any state? https://gist.github.com/db41e069df7bae142248

Follow the player left right, and move mirrored on a line. Works pretty much unmodified for 12 and 13. https://gist.github.com/anonymous/f59ea23c9a421d93c2c1

Re: Show HN: Untrusted, a JavaScript adventure game you play by modifying its source

#200

Any tips for level 17? I can't seem to figure out a solution for the teleporters using the getObjectCoords hint that was given

You can re-target the teleporters. And several teleporters can target one teleporter. And you can iterate over all teleporters and check where they are. I've said too much.
Post reply on HN