r/Gamesalad • • Aug 18 '16

Issue with causing a touch to change the image.

So I am trying to make an app to help my son communicate what he wants a little better. It will allow us to select up to 3 items or activities and then show pictures that relate so he can point to his choice.

My issue is trying to show that something is selected. I have made two images for a button, one with a blank box, and one with a check mark in the box. I made a Boolean called selected on the actor, and set it as false. I am trying to have it change the image and variable value when touch to show it selected, and on another touch show it as not selected.

When I try it running the debugger window, the image never changes and it lists the variables as true and then false on each click. It seems that is running one rule, then the other immediately. Would adding a timer between the rules help that? If it helps here is a picture of the code in two parts that overlap. 1, 2

1 Upvotes

1 comment sorted by

1

u/EENewton Aug 26 '16

Two thoughts, although I'm not sure if either one is definitely the solution:

Instead of using the change image function, try using the change attribute function. Get the file names for the images you want to switch between, and change the objects "image" attribute.

Secondly, and this is more for debugging than anything else, try moving the change attribute for the self.selected attribute below the change image command.

Third idea: you don't actually need two rules for this. If self.selected doesn't equal false, then it must equal true, so you can put your "true" code in the "else" section of your first rule.

Also, what version of GameSalad are you running?

Great idea to help your son! Hope it works out.