Hello there!
So there is this retro game called Galaxian, which you might have heard of. Here is a link to the wikipedia site:
I was wondering, since I find it very interesting, how would you approach the problem with the enemies flying randomly down (curved style) and entering the same place from the top again?
Originally they did a trick and did just make the enemy in place invisible and create a new clone. This clone would move down and as soon as the new clone is in place again, delete the clone and make the original one visible again.
In Phaser 3 I could do a tween for the whole enemy group and do it similar. But I was wondering, isn’t there a more elegant way?
Looking forward what you guys think.
EDIT: I solved the problem for now, not sure though if the nicest way. I move the group not with a tween, but manually and every type of enemy updates the x-position in a separate 2D vector. When the enemy is in the attack state and wants to return, it just creates a tween to that x-position. Since the tween itself takes some time, it will have to reset the x position in the onComplete function of the tween.