Health Bar and Resetting Game or Level

pmadison76pmadison76 Member, PRO Posts: 5
edited May 2014 in Working with GS (Mac)

Hello All,

I am new to game development ( I wouldn't call myself a developer) I do find it fascinating the thought of building a complete game without coding. I am working on a game and am having some issues with the health bar. When I my character encounters an enemy, it shows the bar decreasing but i need to make the player die and reset game. I've tried several different ways through decreasing the health bar to zero and putting a reset game/scene behavior. I have an attribute for the player's health but when it gets to zero nothing happens. Here is what I need:

Need to know how to create multiple lives and somehow trigger the use of a life (not sure if this would be spawning) when the bar gets to 0. Thank you for anyone who can assist me. The game is a platform style game similar to Super Mario.

Comments

  • ogagogag Member Posts: 37

    Create a rule
    When attribute "game.health"=0
    Change scene (depends on the game, can be from initial scene, the scene before the level) or
    Change "self.position x" and "self.position y" (if you want same level & just move back a little)
    Change attribute "game.health" to (whatever number of lives before death)
    Change attribute "game.score" to 0

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    You may be having a problem where the health attribute is going negative and your rule is set for When game.health=0. Try changing the rule condition to When game.health≤0 and see if that makes a difference.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • pmadison76pmadison76 Member, PRO Posts: 5

    Thanks for the help….I actually had the scene to reset and the behaviors set up correctly. I deleted them and set them up again the same way and things are working fine...

Sign In or Register to comment.