08-04-2016, 12:42 PM
You need to use robot's position and orientation to calculate position in front of it and use it as an argument for produce. This code should do it:
If you want it to make a mine behind it, just add 180 to "angle". You can change the distance by changing variable "radius".
Code:
float angle = orientation;
float radius = 5.0;
point pos;
pos.x = position.x + radius * cos(angle);
pos.y = position.y + radius * sin(angle);
produce(pos, orientation, Mine);
If you want it to make a mine behind it, just add 180 to "angle". You can change the distance by changing variable "radius".
"After three days without programming, life becomes meaningless."
~The Tao of Programming
~The Tao of Programming