If Image is checked?

TouchTiltGamesTouchTiltGames Member Posts: 1,162
edited November -1 in Working with GS (Mac)
Bah I'm so close with this but I just can't get it.

In my options screen I want to have 6 images in a line, when you click one, it puts a checkmark above it. There can only be 1 of the images "checked" at a time.

Anyone know of a tutorial for this situation?

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Have attributes s to check if each image has been touched or not,have them set to 0. Have a rule if all of them are 0 have when touch is pressed chang the image to the check image and change its attribute to one.

    So once one is pressed its attribute will be one, and no other ones can be checked because not all of the attributes are 0.
  • spliketspliket Member Posts: 93
    This is how I would do it. There might be a better way. I would create a game attribute called checkBox or something. then, in each actor, I'd create a checked attribute.

    Then, when an actor is pressed, you have it set the game attribute to an integer 1-6 (each having it's own number).
    so...
    when actor receives touch
    change game.checkBox to 4

    Then, have 2 rules in each actor.

    1st rule (example is for actor #4):
    when game.checkBox = 4
    change self.checked to 1
    OTHERWISE
    change self.checked to 0 (this is the part that makes it impossible to have 2 selected at once)

    2nd rule:
    when self.checked = 1
    change image to checked image.
  • TouchTiltGamesTouchTiltGames Member Posts: 1,162
    Thanks guys, I'll try this later today.
  • Rob2Rob2 Member Posts: 2,402
    I wanted to see how efficient I could get this so I have posted a demo http://gamesalad.com/game/12045
  • TouchTiltGamesTouchTiltGames Member Posts: 1,162
    Awesome thanks Rob!
Sign In or Register to comment.