How do I 'Sprite' overlapping Sprite with specific UID?

Get help using Construct 2

Post » Tue May 30, 2017 3:28 pm

How do I 'Sprite' overlapping Sprite with specific UID?

I want to use the overlapping function. But it needs to be specific to a Spriests UID, as there are multiple copies of said Sprite.

How do I do this...
Explain in simple terms... Thanks
B
4
Posts: 3
Reputation: 206

Post » Tue May 30, 2017 7:00 pm

Do not use UID to do such a thing (my opinion).

Mark a Sprite with an instance variable, or an instance boolean.

So.
Give Sprite an instance boolean 'Marked'. (in the layout, in its properties)
Make 'Marked' true for that very specific Sprite. (in the layout, in its properties)

Then: When we want to -- by example -- want to change the animation frame of the marked sprite when it is overlapping another instance of that sprite :

+ Sprite: Is overlapping Sprite
----+ System: For each Sprite
--------+ Sprite: Is Marked
---------> Sprite: Set animation frame to 1
--------+ System: Else
---------> Sprite: Set animation frame to 0
+ System: Else
-> Sprite: Set animation frame to 0
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950


Return to How do I....?

Who is online

Users browsing this forum: Artcadev, Euduardo, Jackriduk and 28 guests