Summary
Good job on getting this far! The space shooter is really taking shape now, featuring a controllable player character that relies on native physics, twin-stick mechanics, enemy ships, and a scene-wide spawner for enemies. All these ingredients together still don't make a game: we can't shoot, we can't increase the score, and we can't destroy enemies. These issues will need to be addressed in the next chapter, along with other technical issues that we'll undoubtedly encounter. Nevertheless, we now have a solid foundation.
By writing a health
script and adding it to both the player and the enemy object, we've reduced the amount of code we need to write. Of course, there will always be times when you need to write code that is specific to one object, but whenever possible, you should design code that can be reused. By converting the 3D camera to a 2D camera, we've learned the differences between the two, and how to configure them. This information...