SIMPLE Question....About Health Bar

kculpepperkculpepper Member Posts: 25
edited March 2014 in Working with GS (Mac)
I have all of the code created for -Health points when it collides with enemy, and +HealthPoints when it hits the Bonus Life actor. My question is, How do I have the bonus life max out at a certain point. For example, if there are 3 lifepoints, and it is -1 for each hit, and +1 for the add life bonus, when it hits the 4th life point, the image disappears, but I do not want it to be able to go any higher than 3.
Education - New Gamesalad Teacher for Middle Schools

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Use the min() math function:

    Change attribute game.health to min(3,game.health+1)
Sign In or Register to comment.