I'm trying to have the enemies in my game jump every X seconds, based on individual value set on each enemy. The enemies use platform behavior (well, PlatformPlus to be exact) and I added an instance variable to the enemy sprite to control the frequency of the jump. ("every ENEMY.frequency seconds" -> "ENEMY simulate PlatformPlus pressing jump")
This works with one enemy, but when there are multiple enemies they all jump based on the frequency value on the first enemy, instead of their own. I tried adding "for each" condition but that only resulted in the first enemy jumping and the other enemy standing completely still. I've probably overlooked something here as there must be a simple solution to this, any help would be greatly appreciated!
Also, I would like to have another instance value for the enemies for delay/offset seconds (so if for example two enemies have their jumping frequency set to 4 seconds, and the other one has delay set to 2 seconds, it will wait 2 seconds before proceeding to jump whereas the first one with delay value of 0 will jump instantly. What would be a good way to implement this kind of behavior? Thanks in advance!