Almost there! I'm on level 20, with the boss. I added a wall so I could get at the phone, but the exit requires the Algorithm! To get it, I must destroy the boss... But if I collide with the boss, it's the player who dies, not the boss. What can I do?
7 Answers
You have 1 block that you can place. Put it somewhere in the middle so you can hide, wait for the boss to move to the other side, and then you can get the phone.
After getting the phone, you need a way to attack the boss. Call me old-fashioned, but I prefer to fight head-on.
Here is the code
map.placeObject(35, 22, 'block');
map.defineObject('missile', {
'type': 'dynamic',
'symbol': '|',
'color': 'blue',
'interval': 100,
'projectile': true,
'behavior': function (me) {
me.move('up');
}
});
map.getPlayer().setPhoneCallback(function(){
var hero=map.getPlayer();
map.placeObject(hero.getX(), hero.getY()-1, 'missile');
});
You could change me.move('up');
to me.move('left');
if you do not want to fight fair.
-
Apparently, I shouldn't fire too much... I got killed by my own missile the first time! Apr 9, 2014 at 22:41
-
3You can also just stop the boss from firing with
Math.random = function() { return 0.4; }
Apr 10, 2014 at 2:28 -
2
-
1
-
1I just found out something interesting about this map: If you "walk" in the line immediately below the bosses (line 7), and stay immobile while the bosses pass near you, the shots will fail to create because "Can't place object on top of the player", so, you actually need no cover, just wait until all the bosses has passed you and move on to get the phone. Sep 29, 2015 at 1:32
Bah to other answers using blocks to hide! We don't need to hide! Take that boss on!
Check your API. There's a function you can use to override up, down, left, or right to do something else. Since you don't actually need to use left, rejigger it to blast the snot out of the boss with an overwhelming show of force.
Here's my anti-bullet barrage, launched by pressing left:
map.defineObject('antiBullet', {
'type': 'dynamic',
'symbol': '*',
'color': 'blue',
'interval': 100,
'projectile': true,
'behavior': function (me) {
me.move('up');
}
});
map.overrideKey('left', function()
{
for (var i = 10 ; i < 20 ; ++i)
for (var j = 0 ; j < map.getWidth() ; ++j)
map.placeObject(j, i, 'antiBullet');
});
Math.random() isn't really random anyway, right... ? :)
Math.random = function() { return 555 }; // that removes bullets
map.getPlayer().hasItem = function(a) { return true; }; // that makes game think you have everything
-
3
-
The second part of this answer no longer works in recent versions of Untrusted.– ppperyAug 18, 2019 at 23:50
I think my solution is a little more apropos.
THE ANTI BOSS!!!
//THE WALL
map.defineObject('b', {
'symbol': '#',
'color': 'blue',
'impassable':true
});
for(var i=3;i<47;i++){
map.placeObject(i, map.getHeight() - 6, 'b');
}
//THE ANTI BOSS
map.defineObject('AntiBoss Bullet', {
'type': 'dynamic',
'symbol': '.',
'color': 'blue',
'interval': 100,
'projectile': true,
'onCollision': function (boss) {
boss.killedBy('the ANTI BOSS');
},
'behavior': function (bullet) {
bullet.move('up');
}
});
map.defineObject('antiBoss', {
'type': 'dynamic',
'symbol': '⊙',
'color': 'blue',
'interval': 100,
'behavior': function (antiBoss) {
if (!antiBoss.direction) {
antiBoss.direction = 'right';
}
if (antiBoss.canMove(antiBoss.direction)) {
antiBoss.move(antiBoss.direction);
} else {
antiBoss.direction = (antiBoss.direction == 'right') ?'left' : 'right';
}
if(map.countObjects('boss')>0){
if (Math.random() < 0.3) {
map.placeObject(antiBoss.getX(), antiBoss.getY() - 2, 'AntiBoss Bullet');
}
}
}
});
var player=map.getPlayer();
player.setPhoneCallback(function(){
var posX=player.getX();
var posY=player.getY()-4;
map.placeObject(posX, posY, 'antiBoss');
});
}
I found carpet bombing a good technique:
map.placeObject(25, map.getHeight() - 4, 'block');
var player = map.getPlayer();
player.setPhoneCallback(function(){
for(var i = 0; i<map.getWidth(); i++)
{
map.placeObject(i,4, 'bullet');
}
});
The first line gives you a hiding point. The second creates a lot of bullets that will then instakill all the bosses (just make sure you are still in cover).
Edit: It seems that my original two rows of bullets on adjacent rows didn't always work (sometimes did, sometimes didn't). I think that sometimes the bullets just killed each other...
There is a way to kill a bos without using phone, adding block or doing any risky tricks.
map.overrideKey('left', function() {
var me = map.getPlayer();
map.placeObject(me.getX(), me.getY() + 1, 'bullet');
var ob = map.getDynamicObjects();
for (var i = 0; i < ob.length; ++i) {
if (ob[i].getType() == 'boss') {
try {
ob[i].move('down');
} catch (_) {}
}
}
});
Now you are not possible to go left, but you can move boss and shoot a bullet using left arrow on your keyboard. What do you need to do now:
- Wait until boss is on the side of the string.
- Press left arrow until all parts of the boss moved down.
- Now there is a free row above the boss. Go here (remember that you will not be able to go left
- Kill a boss by pressing left arrow
- Go to the exit
-
Having to manoeuvre above the boss sounds like a risky trick to me! Nice trick on messing with their movement like that though.– ChrisApr 16, 2014 at 21:34
I just did it in two lines :).
map.getPlayer().hasItem = function(){return true};
map.getPlayer().killedBy = function(){};
Now you cant be killed and you have everything.
hasItem
to pretend I had the Algorithm. Pacifist run!