add encompass world to Game.cs

main
Evan Hemsley 2020-07-11 13:17:30 -07:00
parent 4496e9670a
commit 74d4e231d2
2 changed files with 9 additions and 8 deletions

View File

@ -27,6 +27,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FNA\FNA.csproj"/>
<ProjectReference Include="..\encompass-cs\encompass-cs\encompass-cs.csproj" />
</ItemGroup>
<Import Project="..\build\CopyFNALibs.targets"/>
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" />

View File

@ -1,3 +1,4 @@
using Encompass;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
@ -7,6 +8,9 @@ namespace ProjectName
{
GraphicsDeviceManager graphics;
WorldBuilder WorldBuilder { get; } = new WorldBuilder();
World World { get; set; }
public ProjectNameGame()
{
graphics = new GraphicsDeviceManager(this);
@ -21,7 +25,7 @@ namespace ProjectName
protected override void LoadContent()
{
base.LoadContent();
World = WorldBuilder.Build();
}
protected override void UnloadContent()
@ -31,21 +35,17 @@ namespace ProjectName
protected override void Update(GameTime gameTime)
{
//
// Insert your game update logic here.
//
World.Update(gameTime.ElapsedGameTime.TotalSeconds);
base.Update(gameTime);
}
protected override void Draw(GameTime gameTime)
{
//
// Replace this with your own drawing code.
//
GraphicsDevice.Clear(Color.CornflowerBlue);
World.Draw();
base.Draw(gameTime);
}
}