How do I set boolean to false when not overlapping

Get help using Construct 2

Post » Sun Jun 29, 2014 10:25 pm

Hello.

I'm sure it's pretty easy but my head is dead tonight and i can't seem to find a solution.
If you have an idea that would be nice.

Basically when you press anywhere you span a box. And there are 4 yellow placeholders.
If the placeholder is overlapping with the box set its instance variable to true.

Once you have 4 "true", the game stops.

For some reason the bool does not come to false when the box is not overlapping the placeholder anymore.

Capx:
https://db.tt/JzZzLWDH

Open in debugger, watch window
Last edited by vagaev on Mon Jun 30, 2014 11:40 am, edited 1 time in total.
B
13
S
4
G
1
Posts: 241
Reputation: 1,724

Post » Sun Jun 29, 2014 11:11 pm

The capx need third party addon.
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,155

Post » Mon Jun 30, 2014 1:54 am

Really? Which one?
B
13
S
4
G
1
Posts: 241
Reputation: 1,724

Post » Mon Jun 30, 2014 2:06 am

Plugin Algorithm by Stan Noordman.
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,155

Post » Mon Jun 30, 2014 2:26 am

BlocksToCover=1 is toggling the group state, every tick! Just set to Deactivated, not Toggle.
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

Post » Mon Jun 30, 2014 11:42 am

CapX has been updated.
Thanks for the tip blackhornet. I corrected it, but it's not my problem though.
What i want is that if the block is no longer overlapping the yellow collider then set the collider's inst var to false.

You can eliminate blocks by holding and clicking on a block
B
13
S
4
G
1
Posts: 241
Reputation: 1,724

Post » Mon Jun 30, 2014 12:11 pm

This works how you want it I think.

The Architects.capx


EDIT** Not what you wanted :( just realized that if a physics box falls off and no longer overlaps you'll have the same problem.
You do not have the required permissions to view the files attached to this post.
B
46
S
23
G
7
Posts: 459
Reputation: 6,763

Post » Mon Jun 30, 2014 12:24 pm

OK I fixed it this time I think this is what you are after.

The Architects (1).capx
You do not have the required permissions to view the files attached to this post.
B
46
S
23
G
7
Posts: 459
Reputation: 6,763

Post » Mon Jun 30, 2014 2:31 pm

Thank you @Minor

I can't believe that' it didn't work because i've put box overlapping with trigger instead of trigger overlapping the box. But that makes sense I guess because you are modifying the trigger properties.
B
13
S
4
G
1
Posts: 241
Reputation: 1,724

Post » Mon Jun 30, 2014 2:42 pm

Easy mistake to make.

They way you had it at first looks like it should work but when a box is no longer overlapping the sprite you aren't picking a sprite to reset the bool variable.
B
46
S
23
G
7
Posts: 459
Reputation: 6,763


Return to How do I....?

Who is online

Users browsing this forum: beohs, bilgekaan, Elliott and 13 guests