Arqade Asked on September 24, 2020
In level 6 of Untrusted, how do I avoid the attack drone? I’ve tried creating a new object type that could act as a blocker, but the drone manages to get around it, and I’m convinced there has to be an easier solution that I’m just not seeing.
The drone has a very simple "AI" that chooses moves in a dumb way, so you can exploit that to trap it.
The way I exploited this was:
The full solution I used was:
Correct answer by agent86 on September 24, 2020
You can actually rebind the moveToward
variable, and the re-bound function will be used by the drone. This allows you to trivially reprogram the drone to do movement you want.
Answered by nneonneo on September 24, 2020
or you can build self defences drones :)
map.defineObject('selfDefenceDrone', {
'type': 'dynamic',
'symbol': 'X',
'color': 'green',
'onCollision': function (player) {
player.killedBy('an attack drone');
console.log('killled!');
},
'behavior': function (me) {
moveToward(me, 'attackDrone');
console.log(me.findNearest('attackDrone'));
console.log('-------------');
}
});
map.placeObject(map.getWidth()-9, 12, 'selfDefenceDrone');
map.placeObject(map.getWidth()-5, 16, 'selfDefenceDrone');
map.placeObject(map.getWidth()-5, 8, 'selfDefenceDrone');
map.placeObject(map.getWidth()-1, 14, 'selfDefenceDrone');
Answered by yabree on September 24, 2020
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP