|
|
@ -23,7 +23,6 @@ namespace SemiColinGames { |
|
|
|
|
|
|
|
Scene scene; |
|
|
|
World world; |
|
|
|
Camera camera = new Camera(); |
|
|
|
|
|
|
|
public SneakGame() { |
|
|
|
Debug.WriteLine("MonoGame platform: " + PlatformInfo.MonoGamePlatform + |
|
|
@ -64,11 +63,10 @@ namespace SemiColinGames { |
|
|
|
} |
|
|
|
|
|
|
|
private void LoadLevel() { |
|
|
|
camera = new Camera(); |
|
|
|
world?.Dispose(); |
|
|
|
world = new World(GraphicsDevice, Content.LoadString("levels/demo.json")); |
|
|
|
scene?.Dispose(); |
|
|
|
scene = new Scene(GraphicsDevice, camera); |
|
|
|
scene = new Scene(GraphicsDevice, world.Camera); |
|
|
|
|
|
|
|
GC.Collect(); |
|
|
|
GC.WaitForPendingFinalizers(); |
|
|
@ -112,7 +110,6 @@ namespace SemiColinGames { |
|
|
|
float modelTime = (float) gameTime.ElapsedGameTime.TotalSeconds; |
|
|
|
Clock.AddModelTime(modelTime); |
|
|
|
world.Update(modelTime, input); |
|
|
|
camera.Update(world.Player.Position, world.Width); |
|
|
|
} |
|
|
|
|
|
|
|
base.Update(gameTime); |
|
|
|