Skip to content

Latest commit

 

History

History
62 lines (51 loc) · 1.19 KB

15_exceptionalCrossing.md

File metadata and controls

62 lines (51 loc) · 1.19 KB

Exception approach

lizheming

       'onCollision': function (player) {
            player.killedBy(map.placePlayer());
        }

029ah

       'onCollision': function (player) {
            player.killedBy(none);
        }

dentuzhik

        // Assumes you'll need to go down
        'onCollision': function (player) {
            player.killedBy(map.placeObject(0, player.getY(), 'empty'));
        }

NightmaresSeller

        // Simply throw exception
        'onCollision': function (player) {
            player.killedBy((function() {throw 666;})());
        }

Frenchi

// Shortest possible response - throws "undefined" error.
       'onCollision': function (player) {
            player.killedBy(a);
        }

Redefinition approach

chenxiaoqino

        'onCollision': function (player) {
            player.killedBy();},'type':'item',a:function(){return (0);
        }

CaitSith2

        'onCollision': function (player) {
            player.killedBy();},'onCollision': function (player){//);
        }

XadillaX

player.killedBy() = (0);