Check all instances of an object are at a certain animation frame?


#1

I use animation frames to show the state of an object. Is there a simple way to check all instances of an object are no longer on the first frame of the animation?

I’ve tried

The animation frame of object = 0

paired with

The number of object objects  = 0

but it never seems to get past the first condition.

Is there another way other than using a variable and setting it if there are objects with an animation frame of 0?


#2

why don’t you use different animations like others?


#3
-Normal event
    ?-blank
    !-set variable framecount
-For each event:
    ?-frame of object = 3
    !-add 1 to variable framecount
-Normal event
    ?-framecount = number of object
    !- (Do your stuff)

#4

@Gyuszko, I already use the animations for different types of the object. I’ve got an animal tile (sprite object), which can be one of many animals. I’ve then got the tile as available or collected. So the animation is for each animal type, and the frame is whether it’s available or not.

I’m checking that no animals are available any longer.



@arthuro555, yeah, I though that may have been the way to go. I've done it slightly differently, and tallied up the number of objects on the screen at the start of the scene, and see whether the count of non-zero frames for that object is the same as the tally.

I’m used to using Linq for that kind of thing, and was hoping there’d be a similar one-liner way to do the check.


#5

Why not just add all of the objects to a group, then do a

“For each object in Object Group
Animation Frame = 3 | Do whatever you’re wanting here”

That way it’ll check that against each object in that group.