public void Update(GameTime gameTime) { timeSinceLastUpdate += (float)gameTime.ElapsedGameTime.TotalSeconds; if (timeSinceLastUpdate >= timeToNextUpdate) { FadeMusic(); if (netHandler.Check() == CheckConstants.CHARACTERSELECT) { netHandler.EndSession(); game.SetScreen(new MenuScreen(game, MenuTag.CHARACTERCREATION, this, pName, IP, port)); } CheckInput(); ControlCamera(); foreach (Entity e in entities) { e.Update(); } foreach (ChatHolder ch in new List <ChatHolder>(chatholders)) { ch.Update(); if (ch.isDead) { chatholders.Remove(ch); } } map.update(); ui.Update(); if (paused) { pauseMenu.Update(this); } timeSinceLastUpdate = 0; } }