Shield!

--

Objective: Change the Shield’s color when there are three collisions with it

In the Enemy script, initialize a private int called _shieldCollisionCount. In the OnTriggerEnter2D(Collider2D other) method, increase the _shieldCollisionCount by 1. Also, include the boolean if _shieldCollisionCount is equal to 3, invoke the Player damage method.

In the Player script, create a method called ShieldsColor and set the GameObject’s color. To do this, you need to access the Renderer and set the color of the material. I’m setting mine to a bright green. Put that method within the Damage method.

--

--

KW Development LLC
KW Development LLC

Written by KW Development LLC

Seasoned, result-oriented, highly professional individual with a stellar record of expertise in back-end development and game development.

No responses yet