Hi, I am trying to find out the best way to deal with a game cycle, and I think I might have unfounded concerns about using a loop.
This is a sample from the Roblox place “Capture the flag”, everything is run from the ServerScriptService code:
GameManager:Initialize()
while true do
repeat
GameManager:RunIntermission()
until GameManager:GameReady()
GameManager:StopIntermission()
GameManager:StartRound()
repeat
GameManager:Update()
wait()
until GameManager:RoundOver()
GameManager:RoundCleanup()
end
Functions within, trigger events from modules and overall seems like a pretty neat script.
Questions:
- Is this the best way to handle a game cycle?
- Does having this never ending loop affect game memory usage, processing power, is there anything that could be done to improve it?
Thank you in advance.