After learning about how to use arrays I was able to greatly simplify the Space Rat game code. Now the buildings & clouds are created dynamically (aren't always the same) each time the game is loaded. I separated off objects and functions so the main code is easier to read.
There are a couple problems I need to work through:
- end of game code – how can I check the status of an entire array in an IF statement without calling each value individually ?
- buildings sometimes don't take up the whole sketch / exceed the sketch size
Things that would be cool to add:
- anti space rat guns to make the game more difficult
- building crash effects