Adding a rule for score increase as time passes

I am trying to find the rule for adding points to your scores after so much time passes. Anyone have an idea. Thanks in advance?

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Timer every 5 seconds
         Change attribute game.score to game.score + 100

    Like that?

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

  • lpetrowiczlpetrowicz Member Posts: 12
    the trouble I am having is coming up with the attribute game.score - I initially created the actor for score and pulled it onto upper left corner of scene. Then under rules for "score" I click display text. Under attributes, the first column has both game and score. How do I fix this.

    Next, When I click +Timer, I am unable to type attribute in the behavior area. Any thoughts? Thanks for the help.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    There are three types of attributes in GameSalad: game, scene, and actor (aka self) attributes. The reasoning you are seeing "score" in the attributes menu is because that is the name of the actor. If you changed the name of the actor to "Bob," you would see:

    game
    Devices
    Bob

    (Devices attributes are also game attributes, by the way. Scene attributes only appear when an actor is unlocked.)

    To create a game attribute, you have to look in the attribute browser and click the '+' button. On a Mac, that looks like this:

    image

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

  • lpetrowiczlpetrowicz Member Posts: 12
    I found that, and added the attribute score as a text. Is that what I should have done? Sorry for the questions, I am absolutely new at this.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Text attributes are for... text (words). For a score, you usually want an integer attribute. You cannot change an attribute's type so you'll need to delete it and create it again.

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

  • lpetrowiczlpetrowicz Member Posts: 12
    I see that it needs to be an integer
  • lpetrowiczlpetrowicz Member Posts: 12
    ok, thank you for the help so far. I have the text display working but do not understand why I still cannot get the timer to work. I have it where it says every 5 seconds but cannot do anything else below it for the game.score +100 part
  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2014
    @tatiang
    Timer every 5 seconds
         Change attribute game.score to game.score + 100

    Like that?

    Actually . . . as a bit of code, this is much better:

    Timer every 5 seconds
    Change attribute game.score to game.score + 117

    With my version you get 17 more points every 5 seconds.
  • lpetrowiczlpetrowicz Member Posts: 12
    Sweet, I got it to work. @tatiang, thanks for all the assistance!!!!
Sign In or Register to comment.