How do I use an inverted overlap properly?

Get help using Construct 2

Post » Fri Aug 18, 2017 6:55 pm

Currently I have the following events for toggling a variable change:

Image

The first event listed works and the variable is changed for each specific brick overlapped.

The second event will only work once the Shopsign is overlapping absolutely no bricks (the bricks are sprites lined up right next to each other).

How would I make it so the second event works as the Shopsign moves across the screen of bricks? (the Shopsign is never not overlapping a brick during the game)

I've tried so many variations of the events but I can't seem to get the second event to work the way I want.

Thanks!
Mainly a pixel artist. Check me out here: https://twitter.com/GuttyKreum
B
12
S
4
G
5
Posts: 93
Reputation: 3,044

Post » Fri Aug 18, 2017 10:00 pm

Empty event.
______Action > Bricks > set IsOverlapped to zero (dunno why you do not use a boolean, but hey)
ShopSign Is overlap (Bricks)
______Action > Bricks > set IsOverlapped to 1

Do not use a 'for each' for this.

Replace that GameStart thing with a logic to activate/deactivate a Group.
https://www.scirra.com/manual/80/groups
B
33
S
18
G
29
Posts: 2,493
Reputation: 21,450

Post » Sat Aug 19, 2017 12:50 am

Don't know why I didn't use a Boolean. Isoverlapped is changed to a Boolean now.

It seems to work now with the events below:

Image

Thanks for the help. Can you please elaborate on why you suggested toggling groups on and off?
Mainly a pixel artist. Check me out here: https://twitter.com/GuttyKreum
B
12
S
4
G
5
Posts: 93
Reputation: 3,044

Post » Sat Aug 19, 2017 9:50 am

Well, i did not suggest to use a Group that way.

I said:
Replace that GameStart thing with a logic to activate/deactivate a Group.

You have that reoccurring condition 'gamestart = 1 ?' I suppose that is not used only on those two places. Use Group to bundle all event that run when 'gamestart = 1. And activate/deactivate that Group to your needs.
https://www.scirra.com/tutorials/1444/o ... ing-groups
B
33
S
18
G
29
Posts: 2,493
Reputation: 21,450

Post » Sun Aug 20, 2017 6:03 pm

Excellent. Great elaboration.
Mainly a pixel artist. Check me out here: https://twitter.com/GuttyKreum
B
12
S
4
G
5
Posts: 93
Reputation: 3,044


Return to How do I....?

Who is online

Users browsing this forum: Doctordien, Exabot [Bot] and 5 guests