My journey becoming a Unity game developer: Player lose lives prototype for Galaxy Invaders

Player receiving damage by losing a life after each collision.
Damage() method created to take lives away from the player when they’re hit.
Gaining access to the PlayerBehavior’s script through the GetComponent function.
Player loses lives after each collision, and is destroyed when they run out of lives.
NULL check the PlayerBehavior component before damaging the Player and destroying the Enemy.
Player receiving damage after passing a NULL check.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Rhett Haynes

Rhett Haynes

Learning to become a Unity game developer.