integrating game loop functions with sending updates to clients