I'm having trouble creating light sources that interact with my day and night cycle.
I have a layer with the scrolling coefficients set to 0 so it's always on screen filled with small black hexagons and I've implemented a custom clock into the game.
As the clock changes the transparansy of the hexagons changes.
To do this I've created an Alterable Value on the black hexagons called Time, so at 4am for example the Time Value may be 10 then at 4:30am it may be 15 etc.
I've created three other Altenative Values, Light, Total and Lit.
Every .01 second the Total value is set to the Time + Light values and tthe transparacy of the hexagons is set as the Total value.
This works fine, as the clock goes from midnight to midday the map get's lighter and then darker again as the time goes towards midnight, that's fine.
What doesn't work is light sources I'm trying to add at night.
What I've done is created some objects that will be hidden in the game, and set them so that every .1 second they overlap one of the hexagons the Light Value is set to 100 for example so that bring the Total value at 4am for instance to 110 making the transparency of any overlapping hexagones 110.
To allow for the transparancy to change back to just 10 when not overlapping I also set the Lit value to 3.
Then every .2 seconds 1 is subtracted from the Lit value and another action sets it so that when the Lit value equals 0 or less then Light Value becomes 0 again and the Lit value is set at 0 also.
The first problem is that if I place the lighting objects that change the Light value to the same layer then they will remain on screen while the map below is scrolling. The second problem is that no matter what layer I put them in, they don't appear to be having any effect on the transparency of the hexagons. They still change with the time, but they don't get more transparent when overlapping the lighting objects.
If anyone has any ideas how I can make this work that would be greatly appreciated.
I think the issue could be resolved if I can somehow cause the light object to interact with the hexagons from another layer.