For this week’s assignment, I reworked the asteroids code to utilize the constructor function to make the asteroids. So now it uses that function to create the initial round of asteroids in setup, plus it creates new ones when you press the mouse button.
I also cleaned up some other loose ends: the asteroids disappear when you hit them and the lasers are spliced from the array after they leave the screen.
I would still like to make the asteroids move around some (perhaps in circles using sin and cos?) and maybe make them shoot back. And I need a score keeper. And it would be fun to create multiple levels to the game.
This project has been useful for learning p5 and I’ve enjoyed making it, so I’m thinking about taking it to the next level and maybe turning it into something I can submit for the Winter Show. Toward that end, I’m bringing it to the Crit Group on Thursday to get feedback on how I can change this from a game replicating an existing one to something that’s original. I’m excited to hear the group’s ideas!