Register click on overlapping objects

Discussion and feedback on Construct 2

Post » Mon Jan 26, 2015 12:13 am

Would this be the intended way, to store 1 mouse click on 2 or more overlapping objects (in this case sprites):

overlap_click.gif


Cheers,
thegrind
You do not have the required permissions to view the files attached to this post.
B
26
S
9
G
2
Posts: 78
Reputation: 2,524

Post » Mon Jan 26, 2015 1:10 am

Yes, as long as the mouse is overlapping multiple sprites, one click will apply to all instances under the mouse pointer - and using "for each" is how I would loop through them to play a death animation, or spawn explosions, add points to score, etc...
B
97
S
34
G
20
Posts: 438
Reputation: 17,790

Post » Mon Jan 26, 2015 1:58 am

Good with an affirmation. Thank you for the answer!
B
26
S
9
G
2
Posts: 78
Reputation: 2,524

Post » Tue Feb 03, 2015 8:11 am

How can I perform an action only for the top most character?
B
28
S
8
G
2
Posts: 58
Reputation: 2,586

Post » Tue Feb 03, 2015 8:43 am

@ethanpil

like this..
You do not have the required permissions to view the files attached to this post.
B
48
S
16
G
9
Posts: 1,098
Reputation: 11,197

Post » Tue Feb 03, 2015 10:18 am

What if I have multiple overlapping sprites of different types? Wouldnt this limit it just to the first of selected sprite type?
B
28
S
8
G
2
Posts: 58
Reputation: 2,586

Post » Tue Feb 03, 2015 10:49 am

My first thought is that you could create a family with the different sprite types.
B
26
S
9
G
2
Posts: 78
Reputation: 2,524


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 25 guests