public GameScene(Vector2 sceneSize, Vector2 regionSize) { MatrixRegion = new MatrixRegion <IGameObject>(sceneSize, regionSize); GameObjectCollection = new GameObjectCollection(); GamePlayerSpawnData = new GamePlayerSpawnData(); var lowerBound = new Vector2(-100, -100); var upperBound = new Vector2(100, 100); var gravity = new Vector2(0, 0 /* -9.81f */); PhysicsWorldManager = new PhysicsWorldManager(lowerBound, upperBound, gravity); PhysicsExecutor = new PhysicsExecutor(OnUpdateBodies, OnSimulatePhysics); }
public void Dispose() { MatrixRegion?.Dispose(); PhysicsExecutor?.Dispose(); PhysicsWorldManager?.Dispose(); }