Alien Invasion

Alien Invasion

Our next project was to create a clone of ‘Space Invaders’. This project was slightly more advanced than Biscuit Basher, as it involved the creation of more visual elements and a further exploration of scripting. Furthermore, before I had started developing this project I had an idea of what I wanted the game to look like. This idea including what the sprites and background would look like.

Exploration

The tutorials provided for us were easy to follow. However, after I had finished the final tutorial I wanted to explore further elements which I could incorporate into my project. I pushed myself to be able to make the project feel like a space invaders clone, instead of an unfinished project. I carried out research and included the following features:

  • Shields that protect the player from enemy lasers
  • Enemies that move from one side of the screen to another and gradually descend to the bottom
  • The last enemy speeds up
  • Game Over, Restart and Win mechanics
  • Score mechanic
  • Player boundary
  • 2D Laser sound

I felt with these features that my project would look and feel like a space invaders game, and I had felt like I had reached my goal for this project.

Alien Invasion Interface

Challenges

With my inexperience within Unity, the main challenge I faced for this project was that I wanted to include a death sound for the enemy whenever the players bullet collides with the enemy. However, when I was developing the game I could not figure out a way to make the collision sound work. The sound was created and ready to placed in the game, but Unity was not allowing the sound to play at all. I had added an Audio Source to the Enemy, however an error code was playing each time the enemy was destroyed, stating that a disabled Audio Source could not be played. I had decided with this sound that I would not use it in the final version of the project, as I was happy with how the project turned out in a whole.

Audio Source Error

The script which I felt was the most difficult in this project was the Enemy Controller script. This script consisted of an if statement which controlled how the enemies move. The manner in which the enemies moved is that they moved from one side of the screen to the other side, and when they reached the side of the screen the enemies moved down and then reversed their movement to the other side of the screen. The enemies carried out this movement until they were all destroyed by the player or if they reached the player. I feel the ‘MoveEnemy’ function would be useful in future projects, as I have gained knowledge of how to move enemies in the way they do in this project.

Enemy Controller Script

Unity Strengths and Weaknesses

Throughout this project I have found that Unity changes the canvas size of the project after the project has been built. I experience this issue a couple of times when I had built the project. I then had to go back into Unity and change the scale of the background or the main camera size as these were being shown to a different size after building the project. After some attempts I was finally happy with how the game was being displayed. However, I would put this down as a weakness of the engine, as the built game looks different to the game in the engine for some reason.

On the other hand, I would argue that a strength of Unity is that the engine allows the user to easily import their own sprites into the engine. For this project, I created my own sprites in which I stuck to the space and alien theme, and could easily import them into the project with no trouble at all. Being a beginner, this is very easy for someone new to the engine, as this process was simple enough I did not need to research how to import them.

Additional Research

The additional research I undertook for the project was that I had watched two YouTube tutorials on how to make a ‘Space Invaders’ style game (Barr, 2017; Zigurous, 2021). Personally, I prefer to watch visual content as the development is explained with each step, and a beginner of game design can easily follow along at their own pace. I believe video tutorials are the best place for a beginner to start learning about game engines. I had included elements of both videos into my project, and then added my own sprites onto the objects.

References

Barr, S. (2017) Making Space Invaders with Unity | Beginner Tutorial [Video]. Available online: https://www.youtube.com/watch?v=cnfwNzpoIlA&ab_channel=StephenBarr [Accessed 5/11/2021].

Zigurous (2021) How to make Space Invaders in Unity (Complete Tutorial) [Video]. Available online: https://www.youtube.com/watch?v=qWDQgmdUzWI&ab_channel=Zigurous [Accessed 5/11/2021].

Please click the link to play Alien Invasion – https://nathan1230.itch.io/alien-invasion