Exemplo n.º 1
0
 private void Initialize()
 {
     if (map.RenderIn3D)
     {
         if (grid3D != null)
         {
             Dispose3D();                     //ncrunch: no coverage
         }
         grid3D = new Grid3D(map.Size)
         {
             RenderLayer = 10
         };
         models = new Model[(int)map.Size.Width * (int)map.Size.Height];
     }
     else
     {
         if (grid2D != null)
         {
             Dispose2D();                     //ncrunch: no coverage
         }
         grid2D = new Grid2D(map.Size, Vector2D.Half, GridScale)
         {
             RenderLayer = 10
         };
         rectangles = new FilledRect[(int)map.Size.Width * (int)map.Size.Height];
     }
 }
Exemplo n.º 2
0
		public void CheckDirectionOfBossVillainWithoutPath()
		{
			var grid = new Grid3D(new Size(10, 10));
			grid.RenderLayer = -10;
			var boss = new Boss(BossType.Cloak, Vector2D.Zero);
			AdvanceTimeAndUpdateEntities(5.0f);
			Assert.AreEqual(Vector3D.Zero, boss.Direction);
		}
Exemplo n.º 3
0
		public override void Initialize()
		{
			base.Initialize();
			camera = new GameCamera(1 / 15.0f);
			var grid = new Grid3D(new Size(10, 10));
			grid.RenderLayer = -10;
			new Player();
		}
Exemplo n.º 4
0
		public void CreateCamera()
		{
			window = Resolve<Window>();
			window.BackgroundColor = Color.DarkGray;
			Camera.Current = new LookAtCamera(Resolve<Device>(), Resolve<Window>());
			camera = (LookAtCamera)Camera.Current;
			camera.Position = Vector3D.One;
			logo = new Material(ShaderFlags.ColoredTextured, "DeltaEngineLogo");
			spark = new Material(ShaderFlags.ColoredTextured, "ParticleSpark");
			fire = new Material(ShaderFlags.ColoredTextured, "ParticleFire");
			water = new Material(ShaderFlags.ColoredTextured, "EffectsWaterRanged");
			grid = new Grid3D(new Size(10));
		}
Exemplo n.º 5
0
		public void DisplayBossVillainFollowingPreDefinedPath()
		{
			camera.ZoomLevel = 1 / 20.0f;
			var grid = new Grid3D(new Size(10, 10));
			grid.RenderLayer = -10;
			var boss = new Boss(BossType.Cloak, Vector2D.Zero);
			boss.RenderModel();
			boss.FinalTarget = new Vector2D(2, 2);
			boss.Path = new List<Vector2D>
			{
				new Vector2D(4, 0),
				new Vector2D(4, 9),
				new Vector2D(2, 9),
				new Vector2D(2, 2)
			};
		}
Exemplo n.º 6
0
		private void Initialize()
		{
			if (map.RenderIn3D)
			{
				if (grid3D != null)
					Dispose3D(); //ncrunch: no coverage
				grid3D = new Grid3D(map.Size) { RenderLayer = 10 };
				models = new Model[(int)map.Size.Width * (int)map.Size.Height];
			}
			else
			{
				if (grid2D != null)
					Dispose2D(); //ncrunch: no coverage
				grid2D = new Grid2D(map.Size, Vector2D.Half, GridScale) { RenderLayer = 10 };
				rectangles = new FilledRect[(int)map.Size.Width * (int)map.Size.Height];
			}
		}
Exemplo n.º 7
0
		protected override void Preview(string contentName)
		{
			groundGrid = new Grid3D(new Size(10));
			var modeldata = ContentLoader.Load<ModelData>(contentName);
			new Model(modeldata, new Vector3D(0, 0, 0));
		}
Exemplo n.º 8
0
		public void DisplayCreepFollowingPreDefinedPath()
		{
			camera.ZoomLevel = 1 / 40.0f;
			var grid = new Grid3D(new Size(10, 10));
			grid.RenderLayer = -10;
			var creep = new Creep(CreepType.Cloth, Vector2D.Zero);
			creep.RenderModel();
			creep.FinalTarget = new Vector2D(2, 2);
			creep.Path = new List<Vector2D>
			{
				new Vector2D(4, 0),
				new Vector2D(4, 9),
				new Vector2D(2, 9),
				new Vector2D(2, 2)
			};
		}
Exemplo n.º 9
0
		public void CheckDirectionOfCreepWithoutPath()
		{
			var grid = new Grid3D(new Size(10, 10));
			grid.RenderLayer = -10;
			var creep = new Creep(CreepType.Cloth, Vector2D.Zero);
			AdvanceTimeAndUpdateEntities(5.0f);
			Assert.AreEqual(Vector3D.Zero, creep.Direction);
		}