Files
MonoGame.Extended/Source/Demos/Demo.Platformer/GameMain.cs
T
Lucas Girouard-StranksandDylan Wilson b22a062147 Fix Tiled Problems (#332)
* Add Tiled Content Pipeline library to NuGet

* Update Tiled NuGet package elements.

* Remove dependency on Graphics

* Update csproj for removal of Graphics dependency

* Fix build errors

* Fix problems
2017-01-20 21:08:14 +10:00

47 lines
1.2 KiB
C#

using Demo.Platformer.Screens;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
using MonoGame.Extended.Screens;
namespace Demo.Platformer
{
public class GameMain : Game
{
// ReSharper disable once NotAccessedField.Local
private readonly GraphicsDeviceManager _graphicsDeviceManager;
public GameMain()
{
_graphicsDeviceManager = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
IsMouseVisible = true;
Window.AllowUserResizing = true;
}
protected override void Initialize()
{
var screens = new [] { new GameScreen(Services, GraphicsDevice, Window) };
Components.Add(new ScreenComponent(this, screens));
base.Initialize();
}
protected override void Update(GameTime gameTime)
{
var keyboardState = Keyboard.GetState();
if (keyboardState.IsKeyDown(Keys.Escape))
Exit();
base.Update(gameTime);
}
protected override void Draw(GameTime gameTime)
{
//GraphicsDevice.Clear(Color.Black);
base.Draw(gameTime);
}
}
}