How do I create an animated background?

Get help using Construct 2

Post » Sat Nov 22, 2014 8:27 pm

For a level in a platforming game I have to make an animated background of a nightfall as the sun sets/moon rises. Ideally, it would progress as the player advances through the level so that it would be night by the time he reaches the end.
Last edited by ahtom on Sun Nov 23, 2014 6:08 am, edited 1 time in total.
B
5
Posts: 3
Reputation: 231

Post » Sat Nov 22, 2014 8:34 pm

Hi @ahtom. You could layer a few images over the top of each other for your background and adjust the opacity at timed intervals, starting with the one on top and working through the pile. I don't know if that's the best way forwards but it would work for a gradually changing background like you describe.
Image
B
9
S
3
G
1
Posts: 346
Reputation: 1,560

Post » Sun Nov 23, 2014 1:41 am

Thanks for the reply. I was considering using a giant animated sprite on a layer with 0, 0 parallax to simulate the animated background. However, I think that that way adjusting the animation to match the progess would't be possible.

Is there a way to time events in fuction to certain points of the progess bar in order to get a gradual effect?
B
5
Posts: 3
Reputation: 231

Post » Sun Nov 23, 2014 3:07 am

i have idea for your problem, to know the progress you must compare the the player.X and the layout right edge , now using simple equation you can know the percentage of progress in the level , you can use this to make the bar and the background effects , how to make the background :
you have the layout width and , using the percentage from the level progress you can know the position of the sun,
for example if the you are in 20% of the level you know that the sun.X = 20% of the layout width.
this is the basic idea , you can extend it to make sun and moon , and for the background color just a sprite with different frames colors.
B
12
S
6
Posts: 118
Reputation: 1,466

Post » Sun Nov 23, 2014 4:20 am

Thanks! I'll try to implement it this way.
B
5
Posts: 3
Reputation: 231


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, ST314, tarek2 and 35 guests