Student wants Robots to push each other off the stage.
We can displace one but not the other
In the function on line 50 or 51 (?):
function r2hitr1() {
if (robot1.isTouching(robot2)) {
robot1.displace(robot2);
}
if (robot2.isTouching(robot1)) {
robot2.displace(robot1);
}
}
If we switch the IF statements around then the other robot will displace.
Is there a way to get BOTH robots to displace each other so they are “pushing”?
THANK YOU!!