Manage Health, Damage, and Defeat
Health, or Hit Points, determines how much damage a character or enemy can sustain before it is defeated. Damage is the number that is subtracted from the health when the character or object collides with an enemy. After its health is depleted (reaches 0), the object or character is defeated and should be removed from the game.
To add health to an asset:
- On the Mind Map, double-click the World node where you want to add health to an asset.
- Inside the World, in the Asset panel on the left, double-click the asset to open its Node Map.
- In the Node panel of the Node Map workspace, click Actions to expand the list.
- Drag the Health node to the Node Map grid.
The Health node does not need to connect to the Start node.
- Click the Health node and in the Options panel on the right, in the Health field, enter the number of hit points for the asset. For details, see Health Node.
Now you need to specify the amount of damage to be applied to the character.
To apply damage to an asset when it collides with an enemy:
- In the Node panel, search for the If Collide node and drag it to the Node Map.
- On the Start node, click the Created output and drag a connector to the Enabled input of the If Collide node.
- Click the If Collide node and in the Options panel on the right, in the Affected Assets drop-down list, select Enemy.
- In the Node panel, search for Damage, and drag it to the Node Map.
- On the If Collide node, click the Collide output and drag a connecter to the Enabled input of the Damage node.
- To change the damage amount, click the Damage node, and in the Options panel on the right, enter a numeric value to specify the Damage amount to be applied. For more details, see Damage Node.
Now you need to specify what happens when the character’s health is depleted.
To make a character or object defeated after its health reaches 0:
- In the Node panel, click Actions category, scroll to the Defeat node and drag it to the Node Map.
- On the Health node, click the Defeat output and drag a connector to the Enabled input of the Defeat node.
You’ve defined the amount of health our asset can have and the amount of damage it can sustain. Once defeated, it will be removed from the game.