How do I link a brightness effect to a sprite's size?

Get help using Construct 2

Post » Thu Jul 23, 2015 5:00 am

Hello. Long time (ish) Construct-er, first time caller. How are ya'll doing?

I'm trying to link a brightness effect, more specifically it's value, to the size of a sprite.

I spawn in traffic at the start of the layout like so: https://www.dropbox.com/s/gpzjj400dll9kgp/TrafficSpawnExample.png?dl=0

And here it is in-game: https://www.dropbox.com/s/n9qvfcat6dixjjn/TrafficExample.png?dl=0

I apologise for the bad quality. As you can see I try to size them up or down to show that some are closer or farther away. I'm trying to apply a brightness effect and make the cars darker the smaller they are (or further away they're meant to look).

Here's an example of what I've tried: https://www.dropbox.com/s/sb009pv1tj2ig60/SelfHeightExample.png?dl=0

And the results: https://www.dropbox.com/s/njthyhqxpb27l2e/RegulatedBrightnessExample.png?dl=0

As you can see it doesn't work, no matter what size they are they (the cars) are fully blacked out. The cars are meant to get darker and darker the smaller they are. I'm not sure how to get the effect I'm after, or how to do it.

I'm familiar with linking opacity and scale to bullet speed, which I've done with some stars: https://www.dropbox.com/s/lvgpik9ojxzgf92/SelfOpacityExample.png?dl=0 But that's pretty much as far as my knowledge goes with linking variables (if that's even the correct terminology).

Any help or feedback would be muchly appreciated. If you even come up with a better way to do what I'm trying to do please don't hesitate to say so, I'm open to any and all suggestions.

Thank you for your time and have a good day!
B
6
S
1
Posts: 2
Reputation: 354

Post » Thu Jul 23, 2015 5:55 am

try:
-create object HoverCar
-set instance variable to random(0.03,0.07)
-set scale to instance variable
-set seffect parameter to instance variable*1500

example.capx
Image
B
64
S
23
G
7
Posts: 1,482
Reputation: 10,825

Post » Thu Jul 23, 2015 6:34 am

Thank you very much! Exactly what I was after and it works great.
B
6
S
1
Posts: 2
Reputation: 354


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go and 9 guests