Moved the Function from main to world

The sun cooldown timer is taken from world so it can be changed for
different levels. And we take random number to make it spawn randomly (
inside the grid only )