示例#1
0
        public World(ContentManager Content, GraphicsDevice gdev)
        {
            device       = gdev;
            content      = Content;
            SIZE         = Constants.MAP_SIZE;
            mapData      = new char[SIZE][];
            mapObjects   = new ModelObject[SIZE][];
            moveData     = new byte[SIZE][];
            ground       = new ModelObject[SIZE][];
            player_start = new int[2];
            skybox       = new Skybox(gdev, Content, 2);

            maps = new List <Map>(1);
            scanFiles();

            spawners = new NPCSpawner[4];

            for (int i = 0; i < 4; ++i)
            {
                spawners[i] = new NPCSpawner();
            }

            spawner_count = 0;

            for (int i = 0; i < SIZE; ++i)
            {
                mapData[i]    = new char[SIZE];
                moveData[i]   = new byte[SIZE];
                mapObjects[i] = new ModelObject[SIZE];
                ground[i]     = new ModelObject[SIZE];
            }

            groundObs  = new Model[4];
            ground2Obs = new Model[4];
            ground3Obs = new Model[4];
            wallObs    = new Model[4];
            wall2Obs   = new Model[4];

            #region Objects theme 0
            groundObs[0]  = content.Load <Model>("Models\\floor_sim");
            ground2Obs[0] = content.Load <Model>("Models\\floor_sim");
            ground3Obs[0] = content.Load <Model>("Models\\floor_sim");
            wallObs[0]    = content.Load <Model>("Models\\wall_sim");
            wall2Obs[0]   = content.Load <Model>("Models\\mainframe");
            #endregion

            #region Objects theme 1
            groundObs[1]  = content.Load <Model>("Models\\grass");
            ground2Obs[1] = content.Load <Model>("Models\\grass2");
            ground3Obs[1] = content.Load <Model>("Models\\grass3");
            wallObs[1]    = content.Load <Model>("Models\\stone");
            wall2Obs[1]   = content.Load <Model>("Models\\tree1");
            #endregion

            #region Objects theme 2
            groundObs[2]  = content.Load <Model>("Models\\wasted");
            ground2Obs[2] = content.Load <Model>("Models\\wasted2");
            ground3Obs[2] = content.Load <Model>("Models\\wasted3");
            wallObs[2]    = content.Load <Model>("Models\\rock_w");
            wall2Obs[2]   = content.Load <Model>("Models\\cactus");
            #endregion

            #region Objects theme 3
            groundObs[3]  = content.Load <Model>("Models\\arctical");
            ground2Obs[3] = content.Load <Model>("Models\\arctical2");
            ground3Obs[3] = content.Load <Model>("Models\\arctical3");
            wallObs[3]    = content.Load <Model>("Models\\stone");
            wall2Obs[3]   = content.Load <Model>("Models\\stalagmit");
            #endregion

            _mapID = 0;
            _theme = 0;
            warp(_mapID, _theme);
        }
示例#2
0
文件: World.cs 项目: kayorga/3DSP
        public World(ContentManager Content, GraphicsDevice gdev)
        {
            device = gdev;
            content = Content;
            SIZE = Constants.MAP_SIZE;
            mapData = new char[SIZE][];
            mapObjects = new ModelObject[SIZE][];
            moveData = new byte[SIZE][];
            ground = new ModelObject[SIZE][];
            player_start = new int[2];
            skybox = new Skybox(gdev, Content, 2);

            maps = new List<Map>(1);
            scanFiles();

            spawners = new NPCSpawner[4];

            for (int i = 0; i < 4; ++i)
            {
                spawners[i] = new NPCSpawner();
            }

            spawner_count = 0;

            for (int i = 0; i < SIZE; ++i)
            {
                mapData[i] = new char[SIZE];
                moveData[i] = new byte[SIZE];
                mapObjects[i] = new ModelObject[SIZE];
                ground[i] = new ModelObject[SIZE];
            }

            groundObs   = new Model[4];
            ground2Obs  = new Model[4];
            ground3Obs  = new Model[4];
            wallObs     = new Model[4];
            wall2Obs    = new Model[4];

            #region Objects theme 0
            groundObs[0] = content.Load<Model>("Models\\floor_sim");
            ground2Obs[0] = content.Load<Model>("Models\\floor_sim");
            ground3Obs[0] = content.Load<Model>("Models\\floor_sim");
            wallObs[0] = content.Load<Model>("Models\\wall_sim");
            wall2Obs[0] = content.Load <Model>("Models\\mainframe");
            #endregion

            #region Objects theme 1
            groundObs[1] = content.Load<Model>("Models\\grass");
            ground2Obs[1] = content.Load<Model>("Models\\grass2");
            ground3Obs[1] = content.Load<Model>("Models\\grass3");
            wallObs[1] = content.Load<Model>("Models\\stone");
            wall2Obs[1] = content.Load<Model>("Models\\tree1");
            #endregion

            #region Objects theme 2
            groundObs[2] = content.Load<Model>("Models\\wasted");
            ground2Obs[2] = content.Load<Model>("Models\\wasted2");
            ground3Obs[2] = content.Load<Model>("Models\\wasted3");
            wallObs[2] = content.Load<Model>("Models\\rock_w");
            wall2Obs[2] = content.Load<Model>("Models\\cactus");
            #endregion

            #region Objects theme 3
            groundObs[3] = content.Load<Model>("Models\\arctical");
            ground2Obs[3] = content.Load<Model>("Models\\arctical2");
            ground3Obs[3] = content.Load<Model>("Models\\arctical3");
            wallObs[3] = content.Load<Model>("Models\\stone");
            wall2Obs[3] = content.Load<Model>("Models\\stalagmit");
            #endregion

            _mapID = 0;
            _theme = 0;
            warp(_mapID, _theme);
        }