untrusted-test-only / solutions /bonus /03_theCollapsingRoom.md
lychees's picture
Upload 569 files
87b3b3a

03_theCollapsingRoom.md

urandon: Weather cleaner

If we want to stop the rain, we can destroy rainmaker.

    map.defineObject('rocket', {
        'type': 'dynamic',
        'projectile': true,
        'behavior': function (me) { me.move('up'); }
    });
    map.placeObject(1, 2, 'rocket');

Redefine Math.random

Math.random = function() { return 0.75; }

Edit "objects.js".

 // obstacles
        'block': {
            'symbol': '#',
            'color': '#999',
            'impassable': false
        },

pppery: Variable overwrite

Make blocks fall outside the room too for more time

grid_x = grid_y = 0;
half_width = map.getWidth();
half_height = map.getHeight();