public Level10(int boxesMax, int boxNeed, Vector3 spawnPoint, List<Vector3> billboardList,
            Theme levelTheme, BaseModel levelModel, BaseModel levelModelTwo, BaseModel[] glassModels, Goal catcher,
            Dictionary<OperationalMachine, bool> machines, List<Tube> tubes, LevelCompletionData data, string name)
            : base(10, boxesMax, boxNeed, spawnPoint, billboardList, levelTheme, levelModel, glassModels,
            catcher, null, machines, tubes, data, name)
        {
            currentCameraPoint = RenderingDevice.Camera.Position;

            boxesMaxOne = boxesMax;
            boxesNeedOne = boxNeed;
            boxesMaxTwo = 20;
            boxesNeedTwo = 10;

            spawnTheFirst = spawnPoint;
            spawnTheSecond = new Vector3(197.153f, -4.134f, 1.5f);

            catcherTheFirst = normalCatcher;
            catcherTheSecond = new Goal(new Vector3(313.454f, -3.801f, 5.5f), true);

            baseTheSecond = levelModelTwo;

            Vector3 pos = new Vector3(198.273f, -4.468f, 6.037f);
            ADVertexFormat[] verts = new ADVertexFormat[4];
            verts[0] = new ADVertexFormat(new Vector3(0, 13.686f / 2, -11.359f / 2) + pos, new Vector2(0, 0), Vector3.UnitX);
            verts[1] = new ADVertexFormat(new Vector3(0, -13.686f / 2, -11.359f / 2) + pos, new Vector2(0, 1), Vector3.UnitX);
            verts[2] = new ADVertexFormat(new Vector3(0, 13.686f / 2, 11.359f / 2) + pos, new Vector2(1, 1), Vector3.UnitX);
            verts[3] = new ADVertexFormat(new Vector3(0, -13.686f / 2, 11.359f / 2) + pos, new Vector2(1, 0), Vector3.UnitX);

            buff = new VertexBuffer(RenderingDevice.GraphicsDevice, ADVertexFormat.VertexDeclaration, 4, BufferUsage.WriteOnly);
            buff.SetData(verts);

            blackTex = new Texture2D(RenderingDevice.GraphicsDevice, 1, 1);
            blackTex.SetData(new Color[] { new Color(0, 0, 0, 255) });
        }
示例#2
0
        /// <summary>
        /// Create a new level.
        /// </summary>
        /// <param name="levelNo">The level number.</param>
        /// <param name="boxesMax">The number of boxes the level will give you.</param>
        /// <param name="boxNeed">The amount of boxes you need to win.</param>
        /// <param name="spawnPoint">The Vector3 to spawn boxes at.</param>
        /// <param name="levelTheme">The theme to use.</param>
        /// <param name="glassModels">The array of glass models to use.</param>
        /// <param name="billboardsThisLevel">A list of Vector3's that determine the location
        /// of this level's machine's billboards.</param>
        /// <param name="levelModel">A model of the level's static parts (machine bases and such).</param>
        /// <param name="machines">A list of machines in this level.</param>
        /// <param name="coloredCatcher">If the level has a colored catcher, this is it.</param>
        /// <param name="normalCatcher">The level's Catcher.</param>
        /// <param name="tubes">All the tubes. Lots... and lots... of tubes.</param>
        /// <param name="data">Data detailing the elite requirements of complete completion.</param>
        /// <param name="name">Level's name.</param>
        public Level(int levelNo, int boxesMax, int boxNeed, Vector3 spawnPoint, List<Vector3> billboardsThisLevel,
            Theme levelTheme, BaseModel levelModel, BaseModel[] glassModels, Goal normalCatcher, Goal coloredCatcher,
            Dictionary<OperationalMachine, bool> machines, List<Tube> tubes, LevelCompletionData data, string name)
        {
            levelNumber = levelNo;
            this.levelTheme = levelTheme;
            scoreboard = new Scoreboard(levelTheme.TextColor, boxNeed, boxesMax, 16333);
            this.boxesMax = boxesMax;
            boxesSaved = 0;
            BoxesDestroyed = 0;
            BoxesRemaining = boxesMax;
            boxesNeeded = boxNeed;
            BoxSpawnPoint = spawnPoint;
            levelName = name;
            boxesOnscreen = new List<Box>();
            tubeList = new List<Tube>(tubes);
            MachineList = new Dictionary<OperationalMachine, bool>(machines);
            Board = new Billboard(effectDelegate);

            this.levelModel = levelModel;
            //LevelModel.Lighting = levelTheme.Lighting;
            this.glassModels = new List<BaseModel>();
            textureList = new Texture2D[billboardsThisLevel.Count];
            activeList = new Texture2D[billboardsThisLevel.Count];

            this.normalCatcher = normalCatcher;
            this.coloredCatcher = coloredCatcher;

            CompletionData = data;

            foreach(BaseModel m in glassModels)
                this.glassModels.Add(m);
            foreach(OperationalMachine mach in machines.Keys)
                foreach(BaseModel m in mach.GetGlassModels())
                    this.glassModels.Add(m);

            //foreach(Machine m in machines.Keys)
            //    m.ApplyLighting(levelTheme.Lighting);

            if(billboardsThisLevel.Count != 0)
                Board.CreateBillboardVerticesFromList(billboardsThisLevel);

            for(int i = 0; i < textureList.Length; i++)
            {
                textureList[i] = billboardList[i];
                activeList[i] = activeBillboardList[i];
            }

            dispenser = new BaseModel(Dispenser, false, null, BoxSpawnPoint);
            dispenser.Ent.BecomeKinematic();

            //if(levelNumber != 0)
            //    Program.Game.Manager.CurrentSave.LevelData.SetCompletionData(levelNumber, data);

            gdmReset += onGDMReset;
        }