Trying to get sun working

Anybody has any ideas how to make the sun work kinda like sun in main
menu in Terraria?