forked from MoonsideGames/FNA-VSCode-Template
add encompass world to Game.cs
parent
4496e9670a
commit
74d4e231d2
|
@ -27,6 +27,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\FNA\FNA.csproj"/>
|
<ProjectReference Include="..\FNA\FNA.csproj"/>
|
||||||
|
<ProjectReference Include="..\encompass-cs\encompass-cs\encompass-cs.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="..\build\CopyFNALibs.targets"/>
|
<Import Project="..\build\CopyFNALibs.targets"/>
|
||||||
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" />
|
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" />
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
using Encompass;
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
using Microsoft.Xna.Framework.Graphics;
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
|
|
||||||
|
@ -7,6 +8,9 @@ namespace ProjectName
|
||||||
{
|
{
|
||||||
GraphicsDeviceManager graphics;
|
GraphicsDeviceManager graphics;
|
||||||
|
|
||||||
|
WorldBuilder WorldBuilder { get; } = new WorldBuilder();
|
||||||
|
World World { get; set; }
|
||||||
|
|
||||||
public ProjectNameGame()
|
public ProjectNameGame()
|
||||||
{
|
{
|
||||||
graphics = new GraphicsDeviceManager(this);
|
graphics = new GraphicsDeviceManager(this);
|
||||||
|
@ -21,7 +25,7 @@ namespace ProjectName
|
||||||
|
|
||||||
protected override void LoadContent()
|
protected override void LoadContent()
|
||||||
{
|
{
|
||||||
base.LoadContent();
|
World = WorldBuilder.Build();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UnloadContent()
|
protected override void UnloadContent()
|
||||||
|
@ -31,21 +35,17 @@ namespace ProjectName
|
||||||
|
|
||||||
protected override void Update(GameTime gameTime)
|
protected override void Update(GameTime gameTime)
|
||||||
{
|
{
|
||||||
//
|
World.Update(gameTime.ElapsedGameTime.TotalSeconds);
|
||||||
// Insert your game update logic here.
|
|
||||||
//
|
|
||||||
|
|
||||||
base.Update(gameTime);
|
base.Update(gameTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Draw(GameTime gameTime)
|
protected override void Draw(GameTime gameTime)
|
||||||
{
|
{
|
||||||
//
|
|
||||||
// Replace this with your own drawing code.
|
|
||||||
//
|
|
||||||
|
|
||||||
GraphicsDevice.Clear(Color.CornflowerBlue);
|
GraphicsDevice.Clear(Color.CornflowerBlue);
|
||||||
|
|
||||||
|
World.Draw();
|
||||||
|
|
||||||
base.Draw(gameTime);
|
base.Draw(gameTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue