TOTAL game score...

DrGlickertDrGlickert Member Posts: 1,135
edited November -1 in Working with GS (Mac)
I'd like to make an attribute that records the player's total game score.

I have 60 levels. Do I need to make the change attribute of lvl1score+lvl2score+lvl3score+lvl4score... etc.??

I would like to make it so that if the player plays a level and beats it with 100 pts, then plays again and beats it with 200 pts, the 200 pts is factored into the equation and will replace the 100 pts. The way I'm thinking about doing this is have a "change attribute" after all my Load Attributes in the beginning/opening scene.

I want Total Game Score to be what's submitted to GameCenter.

Any thoughts?

Comments

  • aarioaario Member, PRO Posts: 256
    sounds good to me. If you have a change attribute behaviour say at the start of your game when everything is loading then everytime the player restarts it will update the total score and you can have it post to gamecenter right after. That way the player isnt waiting after every level for the score to be posted, it will post once per session.
  • DrGlickertDrGlickert Member Posts: 1,135
    More specifically, my question is do I have to put in an enormous line of code of 60 individual level scores or is there a more efficient way?

    Example:
    Change Attribute:
    Game.TotalScore to: Lvl1score+Lvl2score+Lvl3score+Lvl4score+Lvl5score+Lvl6score+Lvl7score ... Etc
  • aarioaario Member, PRO Posts: 256
    yeah i see what you mean. Does your game have multiple worlds? If so you could break it up by world and then add those to get the total score. I mean it dosent change the number of attributes but it breaks it up into more manageable pieces.
  • aarioaario Member, PRO Posts: 256
    Other than that I dont see how it could be done. It would be nice if there was an alternate method too because im doing the same thing in my game..
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    you could do it that way or you could try this:

    Keep track of the high score for each level (you may be doing this already).

    Then all you need to do is this.

    If game.levelscore is > game.level10highscore
    change game.TOTALscore to game.TOTALscore +(game.levelscore-game.level10highscore)

    that way you are only adding the improvement to that level's score and not doubling up so to speak.
  • DrGlickertDrGlickert Member Posts: 1,135
    Nice Scitunes! You're the man!
Sign In or Register to comment.