Day to night cycle

Get help using Construct 2

Post » Mon Aug 06, 2012 10:08 am

[QUOTE=Mipey] Something like this? (capx)[/QUOTE]

Yeap, exactly!
Nice one @Mipey

An additional step, dawn is purple.



Heres my edit,
More like this..! (capx)Rory2012-08-06 10:09:39
B
36
S
10
G
6
Posts: 948
Reputation: 11,101

Post » Mon Aug 06, 2012 1:08 pm

@Rory: Link just leads back to this thread :P
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Mon Aug 06, 2012 1:19 pm

Opps!

http://db.tt/vlsOyPZt
B
36
S
10
G
6
Posts: 948
Reputation: 11,101

Post » Thu Jan 10, 2013 3:55 pm

Sorry to drag up the thread again, but any idea on how to get the example to work with what I'm trying to do? I've got a time system based around the fact that 24 hours is 1440 minutes, and converting those minutes to 24 and 12 hour time accordingly.

https://dl.dropbox.com/u/919275/24%2612HourTime.capx

As well, are there any shader effects that would be useful?Candescence2013-01-10 15:55:30
B
94
S
37
G
11
Posts: 404
Reputation: 11,275

Post » Thu Mar 06, 2014 11:32 pm

I'd like to bump this old thread, as well. The expression is incredibly useful, but I can't get it to keep my sun within the layout.

My layout is 1600 by 900. I want the sun completely within that layout throughout the day, but whenever I change the X expression, it ends up being left-aligned rather than centred. Any of you guys have any ideas?

Here's the layout with the basic elements:
LayoutConfinesExample.capx
You do not have the required permissions to view the files attached to this post.
B
5
G
1
Posts: 22
Reputation: 467

Post » Fri Mar 07, 2014 10:21 am

@Allbrotnar, I believe you need to fit a whole sine period within the layout, then. Consult the manual entry on sine behavior and fiddle with it until you get it right.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Fri Mar 07, 2014 11:14 am

The reason is because when Period = 0, Sun.X = 0 too. What you need is decrease the amount you are multiplying cox(Period) by.

This should fix it. And I've used the size of the layout in the maths to ensure it'll always be the same, even if you change layout sizes, as it was originally 3200x900 for and it's 1600x900 in this example.

https://dl.dropboxusercontent.com/u/108 ... ement.capx
Using R238 for all examples
B
60
S
17
G
6
Posts: 363
Reputation: 9,125

Post » Fri Mar 07, 2014 1:04 pm

Awesome! I've fiddled around with the math a bit more, just had to take @emoaeden 's expression (and change it to WindowWidth instead of Layout for the big 3200 layout) and add 250 at the end of it to centre it more. Thanks a lot, guys!
B
5
G
1
Posts: 22
Reputation: 467

Post » Wed Jun 25, 2014 4:22 pm

Hi everybody (first excuse me for my english, please). @Mipey, could you re-up again you capx?? That 400 Dropbox error due to non-file-found makes me cry :)

Thanks in advance.
Greetings.
B
24
S
3
G
1
Posts: 53
Reputation: 1,360

Post » Wed Jun 25, 2014 4:42 pm

But the day/night cycle also depents on the type/perspective of the game. a sidescroll and a top down rts/rpg day and night cycle are vastly different.
disConstruct, a Discord server that's all about Construct 2 !!!
Promote your Construct2 related content, hang out, get feetback, learn some tips & tricks and share your knowledge!

https://discord.gg/0qgSPOo3EsYRQOFt
B
55
S
25
G
6
Posts: 77
Reputation: 6,423

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: R0J0hound, randomly, spcsmrf and 25 guests