Hi, I hardly tried to figure it out by myself and searched in the forum, but failed
Well, there are 2-3 or more objects of the same type, and all of them have their private variable (Action Points).
If one of the objects finished "his turn", his private variable (AP) equals zero,
and another object automatically activates (of course, if his ActionPoints > 0).
So, how to select another object of the same type (his private variable should be >0) after the fist object's private variable check?
Here is the .capx https://drive.google.com/open?id=0B7p49JKt0CGLazFncTNpUm5VbjQ&authuser=0
Oh, you can do that through another variable ))
but may be there is any different solution?
Develop games in your browser. Powerful, performant & highly capable.
I'd probably keep track of the sprite currently selected in a variable, and then use an expression like:
pick selected = 1
ap = 0: set selected = 0
-- pick all
-- pick instance with highest ap
-- ap > 0: selected = 1
Other idea would be checking the ap with a function, that you call after every ap using event, that checks if the ap are 0 and if they are, run the selection again. Performance-wise this would be a bit faster than running the event every turn.