Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MinePlanter
#2
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:

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


Messages In This Thread
MinePlanter - by krakers - 08-04-2016, 10:38 AM
RE: MinePlanter - by tomaszkax86 - 08-04-2016, 12:42 PM
RE: MinePlanter - by krakers - 08-06-2016, 09:08 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)