Generating tiles
start of rain function