Exemple #1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            // Main Background
            mainBackground = Content.Load <Texture2D>("mainbg");
            // Loading Background
            loadingBackground = Content.Load <Texture2D>("loadingbg");
            // TODO: use this.Content to load your game content here
            // Initializing model bank which using for storing model file path
            modelBank = new GameModelBank(Content);
            // Initializing item bank which using for storing item data path
            itemBank = new GameItemBank(Content);
            // Load all model path here.
            Dictionary <short, GameModelConfig> modellist = config.getModelList();

            foreach (short id in modellist.Keys)
            {
                modelBank.Load(id, modellist[id]);
                // Cache
                GameModelNode cache = new GameModelNode(Content, modelBank);
                cache.Load(modelBank.getModelPath(id));
            }
            Dictionary <int, GameItemConfig> itemlist = config.getItemList();

            foreach (short id in itemlist.Keys)
            {
                itemBank.Load(id, itemlist[id]);
            }
            // Load all map
            Dictionary <short, GameMapConfig> maplist = config.getMapList();

            foreach (short id in maplist.Keys)
            {
                mapEntities.Add(id, new MapEntity(id, maplist[id], Content));
            }
            // Server configuration
            serverConfig = config.getServerList()[0];
            // Initializing game camera
            gameCamera = new GameCamera(graphics);
            // Particle system
            particle = new ParticlePreset(this, graphics, gameCamera);
            particle.LoadContent();
            // Game Event handler object
            gameHandler = new GameHandler(manager, network, this, Content, graphics, spriteBatch, modelBank, itemBank, classConfigs, gameCamera, audioSystem, particle);
            // Shadow map
            //shadow.LoadContent(spriteBatch, gameCamera);
            // Bloom post process
            bloom.Settings = BloomSettings.PresetSettings[0];
            // Way to go Effect
            wayToGoEffect = new GameModel(Content);
            wayToGoEffect.Load("waytogo");
            //Debug.WriteLine("LoadedContent");
        }
Exemple #2
0
 public void Load(short modelKey)
 {
     Load(bank.getModelPath(this.modelKey = modelKey));
 }