Ejemplo n.º 1
0
		public void DrawingCreepCreatesCreepModel()
		{
			var creep = new Creep(CreepType.Cloth, Vector3D.Zero);
			creep.RenderModel();
			Assert.AreEqual(1, EntitiesRunner.Current.GetEntitiesOfType<Model>().Count);
			Assert.AreEqual(1, EntitiesRunner.Current.GetEntitiesOfType<Creep>().Count);
		}
Ejemplo n.º 2
0
		private static Creep CreateAndShowCreep(this GameLevel gameLevel, CreepType type,
			Vector2D spawnPoint, Vector2D finalTarget)
		{
			var creep = new Creep(type, spawnPoint) { FinalTarget = finalTarget };
			creep.RenderModel();
			creep.IsDead += () =>
			{
				gameLevel.EarnGold((int)creep.GetStatValue("Gold"));
				gameLevel.DeadCreepCount++;
				gameLevel.CheckChapterCompletion();
			};
			creep.ReachedExit += gameLevel.ReduceOneLife;
			return creep;
		}
Ejemplo n.º 3
0
		public void ShowTowerFiringAtAMovingCreep()
		{
			camera.ZoomLevel = 1 / 20.0f;
			var tower = new Tower(TowerType.Water, new Vector2D(0, 0));
			var creep = new Creep(CreepType.Cloth, new Vector2D(1, 3));
			creep.Path = new List<Vector2D> { (new Vector2D(1, -10)) };
			tower.RenderModel();
			creep.RenderModel();
			new TowerTargetFinder();
		}
Ejemplo n.º 4
0
		public void ShowTowerFiringAtCreepAtRegularIntervals()
		{
			camera.ZoomLevel = 1 / 20.0f;
			var tower = new Tower(TowerType.Water, new Vector2D(0, 0));
			var creep = new Creep(CreepType.Cloth, new Vector2D(2, 0));
			tower.RenderModel();
			creep.RenderModel();
			new TowerTargetFinder();
		}
Ejemplo n.º 5
0
		public void DisplayWoodCreep()
		{
			var creep = new Creep(CreepType.Wood, Vector3D.Zero, 180.0f);
			creep.HealthBar.IsVisible = false;
			creep.RenderModel();
		}
Ejemplo n.º 6
0
		public void DisplayIronCreep()
		{
			var creep = new Creep(CreepType.Iron, Vector3D.Zero, 210.0f);
			creep.HealthBar.IsVisible = false;
			creep.RenderModel();
		}
Ejemplo n.º 7
0
		public void DisplayGlassCreep()
		{
			var creep = new Creep(CreepType.Glass, Vector3D.Zero, 150.0f);
			creep.HealthBar.IsVisible = false;
			creep.RenderModel();
		}
Ejemplo 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)
			};
		}
Ejemplo n.º 9
0
		public void CheckScaleUpdatingForCreeps()
		{
			var creep = new Creep(CreepType.Cloth, Vector2D.Zero);
			creep.RenderModel();
			creep.Scale = 3.0f * Vector3D.One;
			Assert.AreEqual(3.0f * Vector3D.One, creep.Model.Scale);
		}
Ejemplo n.º 10
0
		public void PlaySandCreepTransformsToGlassSound()
		{
			new Player();
			creep = new Creep(CreepType.Sand, Vector3D.Zero, 180);
			creep.RenderModel();
			AttachActionToSpaceButton(TranformSandToGlass);
			fileName = "CreepTransformToGlass";
		}