How do I create a flashlight effect for a 2d stealth game?

Get help using Construct 2

Post » Sun Mar 27, 2016 12:03 am

I'm trying to make a side-scrolling stealth game and the one thing that is giving me issue is figuring out how to make the lighting work. So far I am using sprites to fake lighting effects on a separate layer. At the moment I have a huge black tiled background over the entire play area to act as the shadow. I have a white sprite using the "destination out" filter protruding from the guard sprite to act as their flashlight. I was wondering if there is a better way to go about this. At the moment the effect looks nice, however the second the guard goes near any of the walls, their light sprite clips through it. Same goes with closed doors. Would it be possible to have a flashlight effect that is stopped by solid objects?

I have already tried shadow lights and that failed spectacularly.
B
21
S
8
G
1
Posts: 2
Reputation: 1,933

Post » Sun Mar 27, 2016 12:05 am

Have you tried following this tutorial?

https://www.scirra.com/tutorials/5005/m ... ing-lights
Mistakes were made.
B
55
S
28
G
115
Posts: 1,709
Reputation: 65,116

Post » Sun Mar 27, 2016 12:33 am

Ah, brilliant! This worked perfectly. Thank you!
B
21
S
8
G
1
Posts: 2
Reputation: 1,933


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 26 guests