Problem with life counter
aitor010
Member Posts: 282
Hi!
I have a great problem (for me), I make a game between two players (player vs cpu), in level one when life is 0 change to level 2, but in level 2 when life is 0 NOT CHANGE. I have this conditions:
Condition in actor COUNTER LIFE LEVEL 2:
http://s2.subirimagenes.com/imagen/previo/thump_870601220131121-19.png
When the user is 0 life "in theory" would change to level 3, but, change to -1 -2 -3 -4 -5..... and I want to change to LEVEL 3!!
What can I do?
Thanks in advance!!!!
I have a great problem (for me), I make a game between two players (player vs cpu), in level one when life is 0 change to level 2, but in level 2 when life is 0 NOT CHANGE. I have this conditions:
Condition in actor COUNTER LIFE LEVEL 2:
http://s2.subirimagenes.com/imagen/previo/thump_870601220131121-19.png
When the user is 0 life "in theory" would change to level 3, but, change to -1 -2 -3 -4 -5..... and I want to change to LEVEL 3!!
What can I do?
Thanks in advance!!!!
Comments
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Say:
Rule: attribute game.lifeB <= 0
change scene to game_over
Rule: attribute game.lifeA <= 0
change scene to level 3 intro
If not found the wrong, exist alternatives for put life in the cpu in levels?
Thanks in advance
So what you have in the screen grab is not working?
It seems correct, and should work like you have it here:
Rule: attribute game.lifeB <= 0
change scene to game_over
Rule: attribute game.lifeA <= 0
change scene to level 3 intro
I can see an issue where if lifeA and lifeB happen to be <= 0 at the same time you might get unexpected results though.
I guess lifeB is for the player and lifeA is for the cpu/enemy?
You could handle the players health in the player and handle the enemies health in the enemy (separately) and maybe that will help, something like:
Players Rule:
if lifeB <= 0 AND lifeA >0 then game over.
Enemies Rule:
if lifeA <= 0 AND lifeB > 0 then goto level 3 intro
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
I'd keep them game level attributes so each actor can check each others health as needed.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page