Well you can play it that way too, if you want. Try overriding some of the internal functions using creative methods. :)
4 karma · joined April 8, 2014
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. :)
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.Variable to control the direction the robot moves, changed with the function phone.
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".