Incremental Achievements question
I have one doubt about incremental achievement.
I have one incremental achievement where the player need collect STARS. I use this formula:
(total_stars/100) *100
Every star collected is equal 1%
My question is: I need save the "total_stars" attribute or it need be zero every time i start the game?
Ex: if the player collect 5 stars. I need save 5 to "total_stars" to next time he play the counter start on 5 and increment? Or i don't need save it and when he start again it will start on zero?
I have one incremental achievement where the player need collect STARS. I use this formula:
(total_stars/100) *100
Every star collected is equal 1%
My question is: I need save the "total_stars" attribute or it need be zero every time i start the game?
Ex: if the player collect 5 stars. I need save 5 to "total_stars" to next time he play the counter start on 5 and increment? Or i don't need save it and when he start again it will start on zero?
Best Answer
-
LumpApps Posts: 2,881
I think you need to save the total stars.
In my game I have a atribute that is +1 every time the player does a certain thing. I update the game center achievement after each round with (total/goal)*100
What I also do is ad a maximum to it. It's probably not a big deal but I can imagine game center freaking out if you send over 100% to it.
So I do max(100,(total/goal)*100))
Hope that makes sense.
Comments
It's also a bit strange that you're converting the number of stars into a percent and then back to a whole number. The expression (total_stars/100)*100=total_stars... right? So no need for the formula. Just keep track of game.total_stars.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
ok, lets suppose i use:
(total_stars/500) *100
Do i need save the total_stars or it needs to start always on zero to work with my achievements?
Do i need save my total star to 500 to unlock the achievement or the gamecenter do it for me?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Lump Apps and My Assets