How to add +10 to every 10 game score integer?

Hey Everyone,

So I am trying to make a store in my game. So I want to make it so every 10 score it gives game.money(integer) 10 more dollars if game.score = Any multiple of 10. Also how would I display the money with "Display Text"?

Thanks in advance
Foof

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited February 2014
    One way to do this is to constrain game.money to floor(game.score/10)*10 - game.moneySpent and then add to game.moneySpent when something is purchased from the store.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • guillefaceguilleface Member Posts: 1,014
    i assume you have a real attribute for you score right? now create another real attribute named "bonus" and change this attribute "bonus' to =10


    rule= when score=bonus (score=10 = bonus=10)
    change money to (money+10)
    and change bonus to (bonus+10), this look like score=10 and bonus=20 so you will need every other 10 to give a bonus.
Sign In or Register to comment.