public Enemy() { tieFighter = new Blender(); tieFighter.ReadBinaryFile("test_with_normals.bin"); tieFighter.Scale(new Vector3(0.02f, 0.02f, 0.02f)); float xOffset = random.Next(20)/10f - 1f; float yOffset = random.Next(20)/10f - 1f; float zOffset = random.Next(10)/10f - 0.5f; int colorSelection = random.Next(3); switch (colorSelection) { case 0: tieFighter.SetColor(Colors.RED_COLOR); break; case 1: tieFighter.SetColor(Colors.GREEN_COLOR); break; case 2: tieFighter.SetColor(Colors.BLUE_COLOR); break; default: tieFighter.SetColor(Colors.YELLOW_COLOR); break; } xOffset = xOffset * scale; yOffset = yOffset * scale; zOffset = zOffset * scale; tieFighter.SetOffset(new Vector3(xOffset, yOffset, zOffset)); }
protected override void init() { blender = new Blender(); blender.ReadFile("test.obj"); blender.Scale(new Vector3(0.05f, 0.05f, 0.05f)); blender2 = new Blender(); blender2.ReadFile("test.obj"); blender2.SetColor(Colors.BLUE_COLOR); blender2.Scale(new Vector3(0.07f, 0.05f, 0.05f)); blender3 = new Blender(); blender3.ReadFile("X_Wing3.obj"); blender3.SetColor(Colors.WHITE_COLOR); blender3.Scale(new Vector3(0.1f, 0.1f, 0.1f)); credit1 = new TextClass("X-Wing Model based on Blender model by", 0.4f, 0.04f, staticText); credit1.SetOffset(new Vector3(-0.75f, -0.65f, 0.0f)); credit2 = new TextClass("Angel David Guzman of PixelOz Designs", 0.4f, 0.04f, staticText); credit2.SetOffset(new Vector3(-0.75f, -0.75f, 0.0f)); SetupDepthAndCull(); }
protected override void init() { ship = new Blender(); ship.ReadBinaryFile("xwng_with_normals.bin"); ship.SetColor(Colors.WHITE_COLOR); ship.Scale(currentScale); enemies = new List<Enemy>(); for (int i = 0; i < 10; i++) { Enemy enemy = new Enemy(); enemies.Add(enemy); } deadenembyText = new TextClass("Dead enemby = " + deadEnemyCount.ToString(), 0.4f, 0.04f, staticText); deadenembyText.SetOffset(new Vector3(-0.75f, +0.8f, 0.0f)); credit1 = new TextClass("X-Wing Model based on Blender model by", 0.4f, 0.04f, staticText); credit1.SetOffset(new Vector3(-0.75f, -0.65f, 0.0f)); credit2 = new TextClass("Angel David Guzman of PixelOz Designs", 0.4f, 0.04f, staticText); credit2.SetOffset(new Vector3(-0.75f, -0.75f, 0.0f)); SetupDepthAndCull(); SetupShaders(); }