Problem with life counter

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!!!!

Comments

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    That screen shot is tiny, can you get one larger?
  • aitor010aitor010 Member Posts: 282
    @jamie_c better? http://tinypic.com/r/2dkif7p/5
    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
  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    edited November 2013
    Hi Aitor, much better for my old eyes! LOL

    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
  • aitor010aitor010 Member Posts: 282
    edited November 2013
    @jamie_ c ah okay, then, put rules in every actor not? not in the same right?
  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    I would keep track of the players health in the player and separately keep track of the enemies health in the enemies.

    I'd keep them game level attributes so each actor can check each others health as needed.
  • aitor010aitor010 Member Posts: 282
    ok, I'll go to test! thank you @jamie_c !
Sign In or Register to comment.