I've programmed a health instance variable to allow my player character to take multiple hits from enemies before keeling over, alongside items to refill his health. The problem I'm having is making sure he cannot reach higher than say, 3 Health.
You can use the min() expression.
Ex: Health = min(Health, 3)
It hasn't changed anything. Am I missing something?
Post your events for increasing the value.
Develop games in your browser. Powerful, performant & highly capable.
System -> compare two values -> health ≥ 3
Set Health to 3
Here's the events that change the player's health for reference.
Bacon's method worked, but thanks for the help guys.
-> System: Set Health to min(3, Health + 1)
Do the same for NicoBox.