Death Counter and Adding to Play Store

Now that we have a good part of the game done, let’s quickly add in a method that has the player’s deaths added, along with the game restarting on the player. To start, we will need to use the PlayerPrefs method to keep track of our deaths total after restarting the scene. First, within our UI script, we will create the logic for the deaths total to be saved:

With PlayerPrefs, our death value will be saved and then received to the value upon the restarting of our level. As for the method in which our level restarts, we will have that called in the player script:

With this, we are calling the death count so it adds to our total whenever the player dies. Along with that, we are creating a Coroutine for our reset to occur in to give the player a couple seconds to see their death animation and some time to think about their death:

Within our GameManager, we have it set up for our scene to load. Finally, in order to have it so that our game doesn’t permanently keep track of the deaths when the game is closed and reopened, we will want to go into our main menu and have it set so that when that scene is opened, the value of our deaths is set back to 0:

With that finished up, let’s see our death counter move on up:

Now, let’s look at the process in which we can publish our game onto the Google Play Store. First, let’s go to our build settings and open up the player settings:

In the other settings portion, we will want to scroll down and go to the Identification portion:

What these mean is the Version in which we want to give the game. Normally we will want to go 1.x for smaller build updates, and then upon a bigger “patch” we will go to 2.0. As for the bundle version code, we will always want to increment it up by 1, as this is the version number being pushed forward. Next, we will want to go into our Publishing settings to get our keystore information created:

This keystore information is created so that only those that have the password for the game are able to make further updates to the game. To start, let’s create our keystore:

Before we create our build, we will want to change a quick setting, as google requires 64bit builds:

From there, we will go into the google play console and fill in all necessary information:

Once we have finished with all of the required parts, and the app can be pushed to the store.




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

Recommended from Medium

How I have had to adapt at Andela

Need of messaging queue in Microservices Architecture

3 Things To Know Before Sitting for Software Developer Job Interviews

Quality Assurance (QA) — Why Is It So Essential In Web Development Process?

Remote jobs require remote solutions:

A man and a woman looking for a globe touchscreen

System Monitoring using Prometheus and Grafana

Your time is important!

GPT-3 & The Power of Prompts

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
Jordan Evans

Jordan Evans

More from Medium

Using the Unity Profiler

Cinemachine Example Sheet

Pokemon in Unity: Basics of Scriptable Objects

Scaling Bar HUD for Thrusters