Best way to check for any moving actors?
jon2s
Member Posts: 40
There are a number of different actors on the screen and I want to make sure that none of them are moving before continuing. I have it working fairly well with timers on each actor that checks it's movement and if it is not moving set a game variable to 0, if it is moving set it to 1. This works most of the time.
Curious if anyone has any ideas.
Curious if anyone has any ideas.
Comments
You may want to allow for a small range of movement to consider it not moving as sometimes the actors jitter a bit. There are a few ways to handle this. Been posted about before.
I think I would just use a rule
When self.linear.X = 0 AND
self.linear.Y = 0
do whatever
or you may want to account for "unnoticeable" movements and use <.1 or something
In that game it checks to see if all the red blocks are removed and none of the yellow blocks have left the screen and are not moving.