Best way to check for any moving actors?

jon2sjon2s Member Posts: 40
edited November -1 in Working with GS (Mac)
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.

Comments

  • chosenonestudioschosenonestudios Member Posts: 1,714
    i havnt used game salad viewer but I think you might be able to check it with that
  • rebumprebump Member Posts: 1,058
    Are you setting that game variable to its current value plus 1 if an actor is moving? And its current value minus 1 if it is not? Then you just wait until it's equal to 0 before moving on...

    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.
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    @jon2s - Are you talking about some sort of puzzle game in which checking for no movement is involved in completing the task and finishing the level?

    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
  • jon2sjon2s Member Posts: 40
    Think along the lines of red block remover. (No, I'm not copying your game tshirt:) )

    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.
Sign In or Register to comment.