Reseting scores for each level. *help*

astrom0astrom0 Member Posts: 40
edited November -1 in Working with GS (Mac)
Ok, so I have my main character and some coins and a score display, when my actor collides with a coin it adds 50,100,150 points to the score, which is good and everything but when the scene changes the score is still the same? Is there any way to save the ending results of that levels score to another scene while reseting the score for the next scene and so on and so on?

I appreciate any help =]

Comments

  • AppsRacKAppsRacK Member Posts: 346
    you have to pass the score to a savekey before you leave the scene. And then reset the score value to 0 when you enter the new scene. Use the save & load attribute.
  • astrom0astrom0 Member Posts: 40
    Thanks =] I'm kind of a noob at this stuff.
  • astrom0astrom0 Member Posts: 40
    ok the score changes each level and saves, but now the saved scores in the other scene turn out to be the same amount to the last level i played? Any ideal on why this happens?
  • AppsRacKAppsRacK Member Posts: 346
    well you need a separate key on each level. ex: level1-1Key, level1-2Key, etc.
  • PeeCeePeeCee Member Posts: 107
    Hi Astro.

    thought i'd drop a line to try and assist. so as per drahc's correct answer which is to save your score (which is what your saying your doing now)and just to detail further you'd save each scene score so an attribute/variable to forexample Scene1Score , Scene2Score etc etc whilst your ongoing scoring attribute would be lets say "Score" or "CurrentScore" and so ideally you'd be using change attribute to say game.currentscore = game.currentscore + scene1score (or scene2score etc)
    make sure you load the scene"X"score before using it

    I hope this helps you further. perhaps indicate what your score psuedo looks like for further clarity
Sign In or Register to comment.