Determining close distances with fast-moving actors
I have an actor ("ball") that moves past another actor ("bat") and I am trying to determine when the ball is within a certain distance of the bat. The problem I'm having is that if I increase the velocity to what I'd like it to be (e.g. 150), the ball seems to skip positions as it moves. So it isn't logging self.position.y as 400...399...398...etc., but rather 400...360...320...etc. Since I want to determine magnitude less than 5, I can't get it to work because the magnitude jumps from say 25 (through 0) to 15 on the other side of the bat.
All this is an attempt to avoid using collideable actors for various reasons (constraining attributes chiefly).
Is there another way I can more accurately measure the magnitude between the two actors?
All this is an attempt to avoid using collideable actors for various reasons (constraining attributes chiefly).
Is there another way I can more accurately measure the magnitude between the two actors?
Answers