Buttons over Buttons

Just started using Construct 2? Post your questions here

Post » Thu Apr 16, 2015 10:31 am

On my level complete dialog there is a button to go to the next level.
Because this button is sometimes over a click event in the next level, it can accidently trigger the event.

I have tried "on end of layout" and pausing but with no luck.
What is the best practice to prevent this happening.
B
9
S
3
Posts: 146
Reputation: 1,150

Post » Thu Apr 16, 2015 1:01 pm

There many ways to fix this,depends on your game style.
Can you upload your capx?
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,155

Post » Thu Apr 16, 2015 4:39 pm

the most basic way is to set a 'flag'.

OnClick & LevelCompleteDialogFlag = 0 (for your gameplay click event)

OnClick & LevelCompleteDialogFlag = 1 (for your End Dialogue click)

then just set the flag to 1 when the level is over and it will allow that click to happen and NOT the gameplay click event. Just remember to re-init it to 0 so your gameplay works correctly when you go back into to playing..
B
97
S
31
G
15
Posts: 1,181
Reputation: 16,044

Post » Fri Apr 17, 2015 2:04 am

Thanks will try the flag option
B
9
S
3
Posts: 146
Reputation: 1,150

Post » Sat Apr 25, 2015 1:58 pm

I've created a family "buttons" with boolean variable "isClickable".
Now everything which is clickable should be added to the family and then in event sheet you can create conditions like
On object tapped & object isClickable - do something

Setting isClickable to true/false is like enabling/disabeling the clickable object.
ImageImageImage
B
27
S
16
G
73
Posts: 974
Reputation: 41,157

Post » Sat Apr 25, 2015 6:36 pm

BackendFreak wrote:I've created a family "buttons" with boolean variable "isClickable".
Now everything which is clickable should be added to the family and then in event sheet you can create conditions like
On object tapped & object isClickable - do something

Setting isClickable to true/false is like enabling/disabeling the clickable object.


That's a neat way of doing it.
Thanks
B
9
S
3
Posts: 146
Reputation: 1,150


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest