The next game I'm working is inspired by Space Invaders and is called Laser Defender. The player, represented by a spaceship, moves left and right while shooting projectiles at the incoming waves of enemies.
The game has a singular, infinite level, which gets progressively more difficult as the score gets higher.
This game takes a lot of what was learned in Block Breaker and takes it step further. I am learning the difference between collisions and triggers. There is also a lot more C# scripting involved.
It is at this point that I began to depart from the instruction notes. Now that I am more comfortable with Unity and C# scripting, I wanted to use my knowledge of data structures to represent the alien formations. I also wanted the generation of the aliens to be programmatic, not manually placed in the scene. This approach allows for procedural and random generation of the aliens which makes it easier to have the game increase in difficulty. This is a mechanic that I would like to have in the game that I have in mind to build. In this instance, I decided to use C# Lists to represent the aliens in each stage, and Aliens are removed from Lists as they are destroyed. When the List is empty, we regenerate the field based on how high the score is.
Another new concept in this lesson are the particle systems. This is a really nice feature of Unity that can be used in all manner of ways. The star field background is generated using layers of particle systems. I embellished the particle field quite a bit because I wanted my stars to be more colorful and to move at different speeds, giving a parallax effect and a sense of depth.
Here is the finished version of Laser Defender: