Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Advanced targeting
#3
It's something similar to this (untested, may not work as I wrote it from memory):
Code:
float object::direction(point pos)
{
    float x = atan2(pos.y-this.position.y, pos.x-this.position.x)-this.orientation;
    if (x > 180) x = x-360;
    return x;
}


Messages In This Thread
Advanced targeting - by clop1000 - 07-02-2016, 02:01 PM
RE: Advanced targeting - by radioactivity - 07-02-2016, 02:48 PM
RE: Advanced targeting - by krzys_h - 07-02-2016, 07:44 PM
RE: Advanced targeting - by clop1000 - 07-04-2016, 04:12 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)