So, I have a game body + device, etc., it is, in fact, a ball that bounces around.
I want to determine when it is "pretty much" completed.
I am currently doing this:
public Boolean isStopped() {
return body.getLinearVelocity().x <= 0.3f && body.getLinearVelocity().y <= 0.3f;
}
It basically works, the problem is when a player stumbles something, there is a second where his speed is 0, so this returns true. I really wanted to just return true when it is basically finished. Preferably, within the range that I can set on everything that I like when I customize the physics of my game world.
I can’t use the check whether he is sleeping or not, because it is too late, he does not sleep until he ceases to influence him, I need to do something earlier.
I could just store how long it was stopped / the number of steps stopped, but I was hoping there would be a good previous method that I skipped.
Any ideas?
source
share