How to jump a bunch of players like a wave which are moving in endless platformer?
I am trying to make a game similar to zombie tsunami in which zombies jumps in a wave e.g. the front player jumps first then players behind him jumps a little later which gives a look like a wave. Please help me out with this asap.
I would keep a list of zombies and iterate through them in a coroutine, jumping the first, then yielding a fraction then jumping the second etc etc.
Answer by hexagonius · Jan 28, 2016 at 08:58 PM
sort your zombies for the front most. whenever he performs an action like jumping, add that action to an action queue for each zombie. start checking for a queued actions condition, in that case when the zombie also reached the jump point. if it passed it, jump and dequeue it.
is also possible to sort all zombies doing the same check, but passing the condition to the next one.
the first goes on per zombie performance, the second on initial sort performance