Count Off Screen Actors
tom44410
Member Posts: 5
I'm trying to create a way of counting when actors go off screen. the idea is when all surviving actors leave the screen the level is complete, any help here please?
Comments
Two ways to do this:
(1) Place "wall" actors just outside of the scene boundaries and then use a rule that says When actor collides with [wall actor], change attribute game.actorCount to game.actorCount-1.
(2) Check the position of the actors: When self.position.X > [scene width] + self.size.width/2, change attribute game.actorCount to game.actorCount-1, etc. for all four directions.
Then, have a rule that says When attribute game.actorCount=0, [the level is complete]
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
that's perfect thank you! one more thing? is there a way of counting if actors have been destroyed?? i.e if you start this 10 and only 3 cross the line i still want it to move to the next level.