Day 22 — Putting it all together

public bool collectedShield = false[SerializeField]
private GameObject _shieldPrefab;
private GameObject _shield;
public void EngageShieldPowerup()
{
_shield = Instantiate(_shieldPrefab, transform.position, Quaternion.identity);
_shield.transform.parent = this.transform;
collectedShield = true;
}
public void Damage()
{
if (collectedShield == true)
{
Destroy(_shield.gameObject);
collectedShield = false;
}
else
{
_playerLives -= 1;
}
}
case 2:
if (_player.collectedShield == false)
{
_player.EngageShieldPowerup()
}
break;

--

--

--

Hey and welcome! My name is Connor and my goal here is to put out a daily post for a full year about my game development journey.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

A brief overview of Energy 8 Project 2021 achievements and some plans for the future

Getting Started with TR3

Summon of Talented Holmes

Introducing Polycorn.Finance !

ProphetStor Partners with Nextlink Technology to Exponentially Expand Managed Service Providers’…

Using SAP Cloud Platform local Runtime

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
Connor Fullarton

Connor Fullarton

Hey and welcome! My name is Connor and my goal here is to put out a daily post for a full year about my game development journey.

More from Medium

Internet of the Future

Understanding Wordle as Simple, Spreadable, and Singular

Three screenshots of a game of Wordle

What pollutions does to our water

My Confidence With Designing A Solution To A Problem….