Thursday, 2 June 2016

Unity Tutorial: Arcade Space Shooter

Try version 1 here, I later created an improved version 2.

Next tutorial is an Arcade Space Shooter provided by Unity. Check out the tutorial here.

Concepts Covered: 

  • Creating prefabs that can be reused multiple times
  • Creating objects using code, an infinite number of times, at random spawn places
  • Making my player (space ship) shoot projectiles (laser bolts!)
  • Collision detection
  • Letting objects communicate with each other
  • Adding music and audio to the game
  • Restarting a game once it's ended
This was a lot of fun to build! 

Worthy of note would be the objects communicating with each other. An asteroid knows it's been destroyed and can talk with the game controller, updating the game score.  Likewise, when a player is destroyed it tells the game 'Game Over!' and then the game allows you to restart.

It started feeling more like an actual code project with the class instances interacting.

The tutorial has some extended features you can add, as part of a 2 hour live (not live anymore) tutorial. It looks at adding extra asteroids, some enemy ships that shoot back at you, as well as some general game play improvements.

I'll be taking a look at that next!

Update: Version 2

Try version 2 here.

The extended tutorial really made the game come to life. It becomes actually difficult to score full points on each wave.

I find myself getting frustrated with the WebGL player.

On the one hand, it's ridiculously impressive that this entire game runs from javascript.  On the other hand, the performance is nowhere near as good as the old Web Player (which is no longer supported by Chrome, Firefox or Edge - you have to run it in IE or Opera I believe). Anyway...

Concepts Covered in Version 2:

  • Multiple types of asteroids
  • Enemy ships which fire at you and randomly move around
  • "Teams" as in, the enemy ships cannot shoot their own asteroids/ships but can still shoot you
  • Infinite scrolling background
  • Particle effects to create stars, giving perspective and movement

No comments:

Post a Comment