Because my function cant detect one sided lines until I make it show what actually line actor hit.
Have function
- Code: Select all • Expand view
private void rotate_kitten(line l)
{
if(l)
{
vector2 offset;
double ang;
if(l.delta.x == 0)
offset = (0, 1);
else
{
ang = atan(l.delta.y/l.delta.x);
if(ang == 90 || ang == -90)
offset = (0, 1);
else
offset = (cos(ang), sin(ang) );
}
vector2 a, b;
if(ang > 90 || ang < -90)
{
a = (l.v1.p) + offset;
b = (l.v2.p) - offset;
}
else
{
a = (l.v1.p) - offset;
b = (l.v2.p) + offset;
}
actor.spawn("healthbonus", pos: (a, 0));
actor.spawn("healthbonus", pos: (b, 0));
}
}
which I constantly loop in thinker attached to actor.
So blocking line sets only after actor actually cross that line by its center, not when hit it.
What I can do to get last one sided line which block actor movement, which is what I actually want to get? Or this is bug of 4.2.4 version?