Gradual Distance Opacity

Get help using Construct 2

Post » Wed Jan 09, 2013 10:02 pm

I have multiple light sources in a level called 'light' and I want the brightness of each instance to increase as the player sprite gets closer to them. So this could be a minimum brightness of 30 and a maximum of 90.

I know how to compare distances, but can anyone tell me how to set up a variable which takes that data and outputs within my own set limits of minimum / maximum brightness?

Best,
Mik
B
39
S
12
G
8
Posts: 580
Reputation: 7,108

Post » Thu Jan 10, 2013 12:48 am

https://dl.dropbox.com/u/666574/crudemilk%20-%20light%20distance%20opacity.capx

I've been having brainfarts all day, so I was lucky to get that far! It's not perfect, but it's a start I guess.

Suffered a huge brainfart when trying to factor in a custom distance the player should be before it starts to activate. Maybe tomorrow, I'll figure it out, if you or someone else doesn't first!
B
15
S
5
G
7
Posts: 877
Reputation: 5,650

Post » Thu Jan 10, 2013 11:06 am

That's really good thanks, I'll try this with a 'for each' condition so that it works across multiple lights.

Cheers mate
B
39
S
12
G
8
Posts: 580
Reputation: 7,108

Post » Thu Jan 10, 2013 12:21 pm

No problem. I'll have another go at the custom distance for the player in a bit, if that's something you'd like to have? Or is that version fine how it is?
B
15
S
5
G
7
Posts: 877
Reputation: 5,650


Return to How do I....?

Who is online

Users browsing this forum: Draconinho, totoe and 10 guests