Add 1 live when reach 1000 points

0 favourites
  • 4 posts
From the Asset Store
Full game Construct 2 and Construct 3 to post on Google Play
  • I have 2 variables

    player1_lives

    player1_points

    what I want is that whenever player1_points reach 1000 points adding 1 live to variable player1_lives

    if I put:

    system: player1_points> = 1000

    trigger eleven | add 1 to player1_lives

    life adds 1 life every time I load the level. :-(

    as is the right way to do it??

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • So if they die and have over 1000 points, when the level starts it sees they have over 1000 points and gives them another life right?

    Since your score can go over 1000 you may want to have another variable called player_1up and when you add points to there score also add those points to this variable. When it hits a thousand, give the player a new life, and reset the variable to 0 so that when they respawn or the layout restarts the number is not over 1000 and won't just keep giving them free lives. Don't test on the score variable or they will get a new life everytime the check is made once their score is over 1000. Unless they lose points or you reset the score, it will always be true once they reach 1000 points and at that point anything that triggers the check will give them another life.

    For example if they have 1001 points, and then they get a fee man, then 10 seconds later they are up to 1101 points if the check gets triggered again they would get another free life since they are still over 1000 even though they haven't made another 1000 points. Does that make sense?

    Unless you are already handling those scenarios. It is hard to tell without either an image of your event sheet or a capx.

    Hope this helps...

  • Thanks

    You gave me an idea

    Global_player_next_live = 1000

    System | player1_points >= player_next_live |

    Add 1 to Player_lives

    Add 1000 to player_next_live

    Ready, Thanks <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Awesome, glad to be of assistance! Just remember that if there is anythign in your game that can reset the players score, that you need to reset your player_next_live variable too.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)