Temp_Update()
spawn(1) for(var/area/Level_one/L1 in world)
for(var/atom/A in L1)
A.temperature = temp
spawn(1) for(var/area/Level_two/L2 in world)
for(var/atom/A in L2)
A.temperature = temp
A.temperature -= L2.coolness
spawn(1) for(var/area/Level_three/L3 in world)
for(var/atom/A in L3)
A.temperature = temp
A.temperature -= L3.coolness
spawn(1) for(var/area/Level_four/L4 in world)
for(var/atom/A in L4)
A.temperature = temp
A.temperature -= L4.coolness
spawn(1) for(var/area/Level_five/L5 in world)
for(var/atom/A in L5)
A.temperature = temp
A.temperature -= L5.coolness
Problem description:
I have a sidescroller game, with "levels" going horizontally across the map to tell the game how deep you are into the ground.
I.E LEVEL ONE IS THE SURFACE
My Issue... I wanted the UPDATE TEMPERATURE proc to update all the atoms on the map without causing little freezes every time it does it!!! The game is still playable, but the CPU jump IS noticeable.
Therefore I decided to update the atoms on the map one LAYER at a time. I was wondering if putting spawn(0.1) would do this properly, handling the update of each layer one at a time instead of all in one go.
Is spawn(0.1) the right thing to put there? Should I use sleep(0.1)?? Do I need to use spawn(0.1) for the first layer and spawn(0.2) for the second?? The aim is that the CPU is not doing all this work in one go. Fairly simple
Love and thanks if you can get back to me,
Johnny