FNA-VSCode-Template/ProjectName/ProjectNameGame.cs

53 lines
1.3 KiB
C#
Raw Normal View History

2020-07-11 20:17:30 +00:00
using Encompass;
2020-03-03 23:18:34 +00:00
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace ProjectName
{
class ProjectNameGame : Game
{
GraphicsDeviceManager graphics;
2020-07-11 20:17:30 +00:00
WorldBuilder WorldBuilder { get; } = new WorldBuilder();
World World { get; set; }
2020-03-03 23:18:34 +00:00
public ProjectNameGame()
{
graphics = new GraphicsDeviceManager(this);
graphics.PreferredBackBufferWidth = 1280;
graphics.PreferredBackBufferHeight = 720;
graphics.PreferMultiSampling = true;
Content.RootDirectory = "Content";
Window.AllowUserResizing = true;
IsMouseVisible = true;
}
protected override void LoadContent()
{
2020-07-11 20:17:30 +00:00
World = WorldBuilder.Build();
2020-03-03 23:18:34 +00:00
}
protected override void UnloadContent()
{
base.UnloadContent();
}
protected override void Update(GameTime gameTime)
{
2020-07-11 20:17:30 +00:00
World.Update(gameTime.ElapsedGameTime.TotalSeconds);
2020-03-03 23:18:34 +00:00
base.Update(gameTime);
}
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
2020-07-11 20:17:30 +00:00
World.Draw();
2020-03-03 23:18:34 +00:00
base.Draw(gameTime);
}
}
}