Silhouette when behind an object

Get help using Construct 3!

Post » Tue Jun 13, 2017 8:55 pm

Hello!

Glad to see there is a Construct 3 forum here, now!

I'm making a top-down action game, with a camera similar to a Zelda.
Image

What I want to do is, when the player (the red fruit behind the tree) and other moving objects like enemies (those ladybugs behind the other tree) are behind an object (here, trees), to display their silhouette like in many games with that sort of problematic.
Image
Something like this.

Now I'm sure this is doable with some clever tricks, masks, and blend modes; but I didn't find those tricks. What I'm thinking is a separate layer with plain color tiled backgrounds, and a masking system that only allows part where there is the tree AND the player/object to be visible. Or maybe, a more simple masking system with a clever blend mode/webgl effect.

What do you think?

Thanks a lot for your help!
B
6
S
2
G
1
Posts: 38
Reputation: 603

Post » Wed Jun 14, 2017 7:17 am

Do a search on the c2 forum for Silhouette, there are examples.

You can either set a layer to "force own texture" and then put a duplicate of the object tree on it to act as a mask, then on the same layer a duplicate of the character with blend mode "source atop" or "destination out", can't remember which, then when it overlaps the mask it should work as you want. The mask colour will determin the colour of the silhoutte of the character duplicate which will be invisible until it overlaps the mask.

The other option i used for a game was simply to have a duplicate of the character set to something like 40% opacity and always have it on top of the layer so when it overlaps something you can still see the image rather than a dark shade.
B
43
S
22
G
20
Posts: 735
Reputation: 11,977

Post » Wed Jun 14, 2017 5:24 pm

I'll try that, thanks. :)
B
6
S
2
G
1
Posts: 38
Reputation: 603


Return to How do I...?

Who is online

Users browsing this forum: DrathVader, Nwadkgames and 0 guests