star system

I have a star system in my game where theres three stars and I unlocked each one in the scene then I put when overlap or collide with a plane game level1 stars to game level 1 stars +1 to all three. My problem was if I collect one star and play the level again and get 2 stars it will show I collected 3 stars.

Comments

  • beefy_clyrobeefy_clyro Member Posts: 5,394
    You need to put in a rule that says something to this affect;

    If game.stars > level1stars
    change attribute level1stars to game.stars

    So if level1stars had 1 and then next play you got 2, with the 2 being greater it would overwrite the 1 with a 2.

    You must also make sure that the game.stars value is being reset to 0 before each play, otherwise, it'll just add up from the previous attempt.
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    This will show you how to do it with tables and save creating, saving and loading lots of attributes;

    http://gshelper.com/?p=1476
Sign In or Register to comment.