Having a single enemy that falls from the top of the window to the bottom was a good way to write and test the Enemy class. Now let’s replace that single enemy with a stream of enemies. You can store all the enemies that are in the game using a single Ruby array called @enemies.
The Array class has lots and lots of methods, but you’ll use just three of them in Sector Five.
The push method adds a new object to the array. When it’s time to add a new enemy, you write:
…and one more enemy is added to the array. It’s up to you to make sure you don’t add anything to the array that’s not an enemy. ...