Money and Credits in Attributes or Tables?

iTopGamesiTopGames Member Posts: 71
edited May 2012 in Working with GS (Mac)
Should a put the game money or credits in an attributes or in a table? Is it the same or there are some recommendations about this topic?

Best Answer

  • JohnPapiomitisJohnPapiomitis Posts: 6,256
    edited May 2012 Accepted Answer
    @iTopGames
    @Braydon_SFX

    You dont want in game currency in a table. Put it in a attribute so you can reference them in the first part of a rule.

    For example:

    Say you have a gun that costs 100

    You only want to be able to buy it if you have enough money, so in your buy button you would do when touch is pressed and money is greater then or equal to 100

    You cant do that if its in a table becuase you cant access the expression editor to pull the table value, you can only select an attribute as the first part of the rule.

Answers

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    In a table. :)
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    @JohnPapiomitis - Yeah your right, didn't even think about that.
  • iTopGamesiTopGames Member Posts: 71
    @tshirtbooth Hi bro, yes i saw it, in the tutorial you put the money or credits in attributes, so i'm gonna put it there too, the reason is because there is not index attribute in tables, isn't it?
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    edited June 2012
    @tshirtbooth Hi bro, yes i saw it, in the tutorial you put the money or credits in attributes, so i'm gonna put it there too, the reason is because there is not index attribute in tables, isn't it?
    No its because of the reason i posted above.

    If you can use a index for something you can use a interger
  • iTopGamesiTopGames Member Posts: 71
    @JohnPapiomitis Thanks man, another question i am making a game where you have different scores by levels, and a general score that is the sum of all that scores, i am putting them in a table named "score level" and every time you finish a level the value of the cell where is saved the score changes, if you want to replay the level in order to increase your score the value will only change if it is greater than the last score, so a new high-score, the question is: Am i in the right road? ...Which is the best way to do it, tables or attributes? Thanks in advantage
Sign In or Register to comment.