Untrusted lvl 10 - why is everything recognized as 'empty'?
The map.getObjectTypeAt function returns 'empty' at a robot location, why is this?

Best Answer
That method will return static objects I believe whereas robots are dynamic objects. "Empty" is a specific object type so it is not saying "nothing found" but "I found an object and it is of type "Empty".
I don't know of a good way to get dynamic objects at a specific place apart from by looping through all dynamic objects and checking their XY coordinates.
The getObjectTypeAt method is defined as this:
this.getObjectTypeAt = function (x, y) {
return __grid[x][y].type;
}
The placeObject function is defined as:
this.placeObject = function (x, y, type) {
if (!__objectDefinitions[type]) {
throw "There is no type of object named " + type + "!";
}
if (typeof(__grid[x]) === 'undefined' || typeof(__grid[x][y]) === 'undefined') {
return;
// throw "Not a valid location to place an object!";
}
if (__objectDefinitions[type].type === 'dynamic') {
// dynamic object
__dynamicObjects.push(new DynamicObject(this, type, x, y));
} else {
// static object
if (__grid[x][y].type === 'empty' || __grid[x][y].type === type || __allowOverwrite) {
__grid[x][y].type = type;
} else {
throw "There is already an object at (" + x + ", " + y + ")!";
}
}
};
AS you can see dynamic objects aren't placed in the __grid variable which is where getObjectTypeAt looks for things so it will only pick up static objects.
Pictures about "Untrusted lvl 10 - why is everything recognized as 'empty'?"



Untrusted, all roles and basics of claiming explained.
More answers regarding untrusted lvl 10 - why is everything recognized as 'empty'?
Answer 2
But maybe you are giving the wrong location. Define collision the right way to solve this. The hint was to mess with the drone's programming.
What does the hint ask of you? To mess with the robot's programming.
You are given three spaces. At the Attack drone, re-inforcement drone and defense drone.
The defense drone will not help you. And the attack drone and re-inforcement drones will kill you.
I am going to give you a hint. Define collision for all of them, and do not let them kill the player.
I could spell it out for you. But since you reached this far...
Else I can post my solution.
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Julius Silver, Joshua Welch, Flo Dahm, Karolina Grabowska
