Got rid of previous material system, now uses enumerators and item ids. Also imported QuadTree.cs so we can have entity collision.

This commit is contained in:
2020-06-21 20:17:59 -06:00
parent e25f4d70eb
commit 69c93ea427
25 changed files with 510 additions and 195 deletions

View File

@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using Collector.Character;
using Collector.Dimension;
@@ -19,12 +20,15 @@ namespace Collector
private PlayerMouse _playerMouse;
private OrthographicCamera _cam;
private WorldRenderer WorldRenderer { get; set; }
public static Dictionary<Blocks, Texture2D> Materials { get; } = new Dictionary<Blocks, Texture2D>();
public Main()
{
_graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
IsMouseVisible = true;
IsFixedTimeStep = true;
}
protected override void Initialize()
@@ -32,8 +36,11 @@ namespace Collector
// TODO: Add your initialization logic here
base.Initialize();
BlockMaterials.Initialize(Content);
foreach (Blocks name in Enum.GetValues(typeof(Blocks)))
{
Materials.Add(name,Content.Load<Texture2D>(name.ToString()));
}
var viewportAdapter = new BoxingViewportAdapter(Window, GraphicsDevice, 800, 480);
_player = new Player(0, 0);
_cam = new OrthographicCamera(viewportAdapter);
@@ -49,7 +56,6 @@ namespace Collector
{
// TODO: Add your update logic here/*
base.Update(gameTime);
World.LoadChunks();
World.UnloadChunks();
}