Buttons run as soon as they are active & visible if area previously pressed?
StormyStudio
United KingdomMember Posts: 3,989
Good evening, just testing my game (made 11 levels now),
Tricky describing what is simple problem.
Simple description:
Buttons run rules as soon as they are active and visible if the area was previously pressed.
Confusing description:
just realized that my 'retry level', 'main menu' and 'next level' buttons which appear after successfully completing/failing the level. They will run their rules if the button area has been pressed during a ten second timer before they are visible or active as soon as they are visible and active,.
The buttons are setup properly so they are only visible if game is successful/failed and 'if touch is released, and self.colour.alpha = 1 then do such and such i.e. change scene'.
What can I do to stop this, as I don't want users accidentally choosing main menu, when they were simply tapping the screen by mistake, when no buttons are active or visible.
The buttons are transparent during the level and only fade up at the end, they are not spawned.
Could I put a rule in before the buttons appear, so that 0.1 secs before the timer runs out make the number of presses '0', or is there another way?
I'm sure technically it should not happen, as the rules all make sense.
I guess the buttons could be positioned off screen and move in when needed, but since I'd need to do that for 11 levels, what other way would work? (I'd done lots of testing before moving on from level 1 but missed this...)
Tricky describing what is simple problem.
Simple description:
Buttons run rules as soon as they are active and visible if the area was previously pressed.
Confusing description:
just realized that my 'retry level', 'main menu' and 'next level' buttons which appear after successfully completing/failing the level. They will run their rules if the button area has been pressed during a ten second timer before they are visible or active as soon as they are visible and active,.
The buttons are setup properly so they are only visible if game is successful/failed and 'if touch is released, and self.colour.alpha = 1 then do such and such i.e. change scene'.
What can I do to stop this, as I don't want users accidentally choosing main menu, when they were simply tapping the screen by mistake, when no buttons are active or visible.
The buttons are transparent during the level and only fade up at the end, they are not spawned.
Could I put a rule in before the buttons appear, so that 0.1 secs before the timer runs out make the number of presses '0', or is there another way?
I'm sure technically it should not happen, as the rules all make sense.
I guess the buttons could be positioned off screen and move in when needed, but since I'd need to do that for 11 levels, what other way would work? (I'd done lots of testing before moving on from level 1 but missed this...)
Comments
will have a thorough look through whole project tonight...
Possibly not the tidiest way, and not sure why it is needed, but it works....
I had te same question a while back and tshirt suggested layers.
Works great anything in the gamis on layer one ui layer two etc.
So whatever causes a button to pop up also changes te layer attribute to 2. Then the rule in the stuff under neath requires layer o e to be pushed you can stack as many as you want
http://gamesalad.com/game/play/48051
have 4 layers in the ui in this one
hope that helps.
To be honest I got confused trying it at first
make an attribute called layers