Health Bar and Resetting Game or Level
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
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
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
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...