Maybe defining a length for your array would be a good start. How many invaders would be enough? Hint: How many invaders can there ever be at once before the player has lost?
Next, you’re going to need to fill those potential spaces up. Obviously your invaders are represented by the numbers 0 to 9. So what would be a good number to use to represent a spot with no invader? You start with no invaders, right? So then you can use a loop to put a “no-invader” number in every possible spot.
Can you use a loop to draw all the invaders now? Does it matter if you always draw all of them? Do you always have to draw something for every value?
When does a new invader appear? How can you add a new invader to your array of invaders?
When does an invader disappear from the array? What happens to the value for that invader? How about the values after it in the array?
When an invader disappears, does the forward-most invader’s drawn position have to move back?
All these questions are meant to promote thinking about the problem, but feel free to try to write out your answers and post them so we can see your thought process…