Better HN
topnewbestaskshowjobs
Log inSign up

SheeEttin

4 karma · joined Apr 8, 2014 (12y ago) · 8 submissions

Submissions

comment 12y ago · link · parent

Well you can play it that way too, if you want. Try overriding some of the internal functions using creative methods. :)

comment 12y ago · link · parent

We've also been discussing it over on reddit: http://www.reddit.com/r/webdev/comments/22gxx1/untrusted_a_j...

comment 12y ago · link · parent

Ooh, shift, nice. Didn't know about that. That should come in handy.

comment 12y ago · link · parent

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. :)

https://gist.github.com/anonymous/2868beb0cee19259ebb5

comment 12y ago · link · parent

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.

comment 12y ago · link · parent

https://gist.github.com/anonymous/12b15e3de9340655ed78

Variable to control the direction the robot moves, changed with the function phone.

comment 12y ago · link · parent

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".

comment 12y ago · link · parent

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