Adding player interaction
Before there can be any ostensible gameplay, we must accept and react to some form of player input. This gives the player some level of agency within the game. Let's learn how to do this now.
Initializing the variables
The very first thing we need to do is initialize the values of our attributes. We can do this when the actor is first loaded into the scene, using the When Creating event. Let's add a When Creating event to the Player Handler behavior now by performing the following steps:
From the Dashboard, under LOGIC, select Actor Behaviors and open up the Player Handler behavior.
Navigate to Add Event | Basics | When Creating to add a when created event to the behavior, as shown in the following screenshot:
In the blocks Palette, select the Attributes tab, then click on Setters, and you will see a range of setters for each attribute, which we have already created, broken down into their attribute types, as shown in the following screenshot:
Scroll down to the Number...