Interesting, probably much simpler than my approach:(I have added a few comments to give a brief explanation:
//Math.random = function(){ return false;};
/* my first Idea was to try and redefine Math.random to always return <0.3, but for some reason even though this did effect the dropping of bullets, it didn't stop them completely (if someone could explain this I would really appreciate it*/
map.defineObject('MagicBlock', {
'type' : 'static',
'symbol' : '$',
'color' : 'magenta',
'impassable' : function() { return map.countObjects('boss') >0;}
});
//place a row of MagicBlock's aboove the player's starting position
for(var i =0; i < map.getWidth(); i++)
map.placeObject(i, map.getHeight()-5, 'MagicBlock');
map.defineObject('missile', {
'type' : 'dynamic',
'symbol' : '^',
'interval' : 100,
'projectile': true,
'behavior' : function(me) { me.move('up');},
'color' : 'lime'
});
player = map.getPlayer();
function volley(){
for(var i = 0; i < map.getWidth(); i++)
map.placeObject(i, map.getHeight()-6, 'missile');
map.placeObject(i, map.getHeight()-7, 'missile');
}
map.getPlayer().setPhoneCallback(function(){
volley();
});