How can I toggle groups of images, but leave any images that have been previously selected

jdgouldjdgould Member, PRO Posts: 114
edited April 2012 in Working with GS (Mac)
Newbie here and haven't found my answer looking through the forum.

I have options at the bottom of the screen (forks, spoons, etc...) when someone clicks forks, i want all of the fork options to be displayed on the right half of the screen and then they might drag one or two to the left side of the screen. When they click on spoons, i want the forks that were on the left side to remain, but I want the right side to display various spoon options and visa versa. In other words, i want to toggel a bunch of different forks and spoons and only remove the ones that haven't moved to the left half of the screen when being toggled.

Thanks and appreciate your help.

Best Answer

  • tatiangtatiang Posts: 11,949
    edited April 2012 Accepted Answer
    Sure, you can do that. When self.position.X is less than 240...

    Using When ALL or When ANY, you can specify conditions for certain areas of the screen. You could also have an invisible (self.color.alpha=0) actor that covers part of the screen behind/beneath your other actors and have rules on your spoons/forks that say When actor collides with hiddenArea [do something... move back to original location, destroy, etc.].

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

Answers

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    In your fork and spoon actors, create a boolean attribute called self.moved. If the player moves/selects a fork, have that actor change attribute self.moved to self.moved = true. Then when you display/move all of the fork options on the right side, have a rule that says to do that only if self.moved is false.

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

  • jdgouldjdgould Member, PRO Posts: 114
    Thanks, but what if they moved a fork or spoon, but it is no longer on the left side of the screen. In other words, they selected a spoon, moved it around, but then put it back on the right side with all of the other spoons. Is there a way to also include coordinates or something?
Sign In or Register to comment.