Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
My super move is not so super after all.
#2
What is the chkpos function supposed to actually do? Return a point c meters in front of the robot? (I'm too lazy to try to understand the whole code Tongue)

If so... why not just
Code:
point object::chkpos(int c)
{
   point p;
   p.x = this.position.x + cos(this.orientation) * c;
   p.y = this.position.y + sin(this.orientation) * c;
   p.z = topo(p);
   return p;
}

I can't see any other immediate problems, other than the way you do the altitude choice could probably be done better - I'd just let the wasp stay at around z=max(topo(this.position), chkpos(20))+some_arbitrary_altitude_above_ground. Anyway, your code seems to work fine for me, unless you have some level with terrain changes big enough for it to break.


Messages In This Thread
RE: My super move is not so super after all. - by krzys_h - 03-27-2017, 07:31 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)