How do I create nice lighting effect?

Get help using Construct 2

Post » Tue May 05, 2015 11:46 am

Hi all,

I'm trying to improve the lighting in my game. I have seen some of the examples and made some test but I haven't been able to actually make something really nice.

I wonder if it's possible to make the lighting in Construct2 like in Alto's Adventure and if yes how would you do it?

https://www.youtube.com/watch?v=Wk5JupHelAg

If you can point me to some examples (capx) or have any advice to give me, I'd be very grateful.

Thanks!
B
12
S
2
Posts: 85
Reputation: 899

Post » Tue May 05, 2015 2:30 pm

If it's the sun and moon lighting you are referring to, it should be quite easy to do.
-First, create a round gradient the color of the sun (can be done on a black background if you want), and a sun sprite.
-Animate the sun sprite moving across the sky on a layer underneath your foreground layers.
-Make sure the gradient is on the top layer above the foreground layers. (if you made your gradient on a black background, set the blending mode to 'add')
-Create an event that sets position of the gradient to the current sun position every tick.
-Tada.
Be sure to check out my Metroidvania game, A Hole in the Earth
B
59
S
24
G
3
Posts: 359
Reputation: 5,683

Post » Tue May 05, 2015 2:34 pm

Thanks a lot! I'll give it a go in a minutes then :)

I'm actually going to post a new thread about a bug I can't figure out to fix.
B
12
S
2
Posts: 85
Reputation: 899

Post » Tue May 05, 2015 5:02 pm

No problem! :)
If you haven't figured out the lighting bit by the time I have some free time tonight (in 8 hours or so), I'll make a capx for you.
Last edited by ryanrybot on Wed May 06, 2015 3:41 am, edited 1 time in total.
Be sure to check out my Metroidvania game, A Hole in the Earth
B
59
S
24
G
3
Posts: 359
Reputation: 5,683

Post » Tue May 05, 2015 8:42 pm

I would be grateful if you could make a capx for me :D

I tried but it does not look very good, so I am curious to see what I'm doing wrong. Do not worry about the animation bit, that's fine. I'm really interested in the visual result :)

Thanks a lot!
B
12
S
2
Posts: 85
Reputation: 899

Post » Wed May 06, 2015 3:40 am

Is this the effect you're after?
Just move the mouse around. :)
https://dl.dropboxusercontent.com/u/30500491/SunzInYoFace/index.html


Here's the capx as well.
(latest beta version needed)
https://dl.dropboxusercontent.com/u/30500491/sun-lighting-effect.capx
Be sure to check out my Metroidvania game, A Hole in the Earth
B
59
S
24
G
3
Posts: 359
Reputation: 5,683

Post » Wed May 06, 2015 4:50 am

Wow, ryanrybot. That looks fantastic. I haven't gotten the beta yet, but as soon as I do I'll be digging through that capx. Great job!
B
3
Posts: 7
Reputation: 239

Post » Wed May 06, 2015 9:06 am

@ryanrybot Wow that's really cool! Thanks a million

That's exactly the type of effect I'm after! I'm goin to check out the capx immediately!
B
12
S
2
Posts: 85
Reputation: 899

Post » Wed May 06, 2015 12:30 pm

@DoudouSupreme and @SVEDEN11, thanks a bunch! :)
I went to bed last night thinking I really messed up on the lerp calculation, so I double checked the lerp and dt tutorial Ashley wrote https://www.scirra.com/blog/ashley/17/using-lerp-with-delta-time, and boy was I way off.

I have fixed the capx, if you want to use a more reliable calculation. ...hopefully. :P

https://dl.dropboxusercontent.com/u/30500491/sun-lighting-effect.capx
Be sure to check out my Metroidvania game, A Hole in the Earth
B
59
S
24
G
3
Posts: 359
Reputation: 5,683

Post » Wed May 06, 2015 2:26 pm

Thanks a lot! To be honest, I always use f * dt because Math is not my thing, and art neither :D
B
12
S
2
Posts: 85
Reputation: 899

Next

Return to How do I....?

Who is online

Users browsing this forum: Anonnymitet, tarek2 and 18 guests