[SOLVED] Obscure "problem" with lighting and parallax

Get help using Construct 2

Post » Sat Jun 18, 2016 8:25 am

Hey guys,

I've come across an interesting issue, and wondering if anyone has any idea how to work around it - or if maybe I'm doing something wrong.

I have several layers set up in my game, the newest one being my "sky" layer which I use to make day and night. It's a blank layer set to black background with opacity set lower than 90, and I'm using for lighting (sprites set to 'destination out').

The problem I am having is - some layers are parallaxed and have objects that I'd like to give off light - while other objects are on my "non-parallaxed" layers which also need to give off light. Obviously this causes an issue when you start scrolling around the layout, since the light source for the parallaxed layers doesn't stay on the object where it should.

I've tried creating more than one lighting layer (setting one to the parallax scroll rate and leaving the other one as default), but the effect of lighting is massively diminished by whichever lighting layer is below the other.
Am I doing something wrong? Is there a better way?

Hopefully I have explained my issue correctly.

I managed to find an expression I've never seen or used before - Oh Construct 2 how do you still surprise me?!

Just in case anyone else runs into this same problem I found the solution in this tutorial by @Katala

I'm using only the ONE lighting layer still, but tracking the coordinates of the parallaxed object(s) by using the above expression.

Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Posts: 3,032
Reputation: 30,474

Return to How do I....?

Who is online

Users browsing this forum: purplemonkey, tdcostas and 5 guests