How do I create day and night

Get help using Construct 2

Post » Fri Mar 20, 2015 7:17 pm

how do I create day and night,like when the time is midnight change to night
B
15
S
4
Posts: 153
Reputation: 1,385

Post » Sat Mar 21, 2015 6:27 pm

First, you need the "Time" (Counter, Value, Sprite with animation, whatever you want).
Then you need a method, to "show" that's night. You can make this with Layout-Effects or a dark layer with changing opacity.
At last you have to say, when it's night (Counter have a special value) - show Night-Layer/special Layout-Effect.
When it's day (...) hide Night-Layer/special Layout-Effect.

Thats the simple answer ;)
B
21
S
5
G
2
Posts: 180
Reputation: 3,497

Post » Sat Mar 21, 2015 6:34 pm

Well.....I didn't understand most of your answer,but thanks for answering.

I already figured a way to make it.

That's also a simple answer ;)
B
15
S
4
Posts: 153
Reputation: 1,385

Post » Sun Mar 22, 2015 6:00 am

What exactly you don't understand?

You need the Time - a counter, a global value - that shows you, whats the time.
Then you have to say, that when it's between 6am and 6pm it's day, between 6pm and 6am it's night.
For day - or better say for the night you can use layout-effects or an dark, semitransparent layer, that will shown, when it's night.

Thats the idea of day and night circle!

But it would be interesting, how you did it now?
B
21
S
5
G
2
Posts: 180
Reputation: 3,497

Post » Sun Mar 22, 2015 9:28 am

I don't need a counter I just need when the time is 12am it turn into night.

At the beginning of the layout its day So I made a global variable set to 600 (10 minutes in real life ) and every 1 second it subtract 1

When the global variable is 0 it Turns to night and wait another 600 seconds

When those 600 seconds done it reset the global variable to 600 And turn to day again. :D
B
15
S
4
Posts: 153
Reputation: 1,385

Post » Sun Mar 22, 2015 2:52 pm

Your global variable with 600 is that what i mean with "you need a time" ;)
When your variable is 0 (and resetting) is what i mean with "say when it's night or day" ;)
B
21
S
5
G
2
Posts: 180
Reputation: 3,497

Post » Sun Mar 22, 2015 3:46 pm

Ok,then the both solutions are good.

Anyway thanks for your help.

;)
B
15
S
4
Posts: 153
Reputation: 1,385


Return to How do I....?

Who is online

Users browsing this forum: dhens09 and 3 guests