private void FrameTick(object sender, ElapsedEventArgs e) { lock (locker) { if (paused) { return; } Time.Update(); var activeObjects = map.GetGameObjects(GameBasicCamera); activeObjects.ForEach(x => x.Update()); Physics.StepWithDelete(0.01666667F, 3, 6); map.UpdateMap(GameBasicCamera, GameBasicCamera.Size); GameBasicCamera.Update(); manager.Update(); Tick?.Invoke(activeObjects, GameBasicCamera); Controls.ClearOneFrameValues(); if (!win) { return; } Pause(); map.RemoveObject(ship); ship.DeletePhysics(); GameModelChanged?.Invoke(data.MainModel); } }
private void FrameTick(object sender, ElapsedEventArgs e) { lock (this) { if (Paused) { return; } Time.Update(); Physics.StepWithDelete(0.01666667F, 3, 6); var activeObjects = map.GetGameObjects(GameBasicCamera, GameBasicCamera.Size); activeObjects.ForEach(x => x.Update()); map.UpdateMap(GameBasicCamera, GameBasicCamera.Size); GameBasicCamera.Update(); Tick?.Invoke(activeObjects, GameBasicCamera); Controls.ClearOneFrameValues(); } }