Making blocks darker if further away

I started making a little game for halloween today, and I’m wondering if i can compare the difference between the position of the player, and the position of the block to get a number to turn into the dark/lightness of the block.

this is the game: https://flowlab.io/game/play/1449810

the block should be called “dirt”

@TinkerSmith @JR01 i thought maybe one of you might know idk

if anyone knows how to do this please tell me

1 Like

Hey @F3Art, I made an example for this with a custom Distance bundle.

But follow what I did here to get the results below:

@JR_01 thank you! this makes the game a lot scarier than it was before. btw what do you think of the game so far?

Not bad overall, I’m interested what your going to make.
Make sure to use 100 instead of 80 in the expression since your blocks are already so dark.

Also @F3Art:
I just updated that example so you can change the light between by Grid and by Pixels.
(Refresh the page and press F)

1 Like

@JR01 oh wow, i might switch to that. that’s really cool. thanks for alll the help! I’ll be sure to mention you in the credits when I’m done. I’m hoping to have the game done before the end of october.