public void Load()
        {
            // Load player sprites
            this.settings.addSprite(TextureContent.LoadDictionaryContent <Texture2D>(this.game.Content, @"Graphics\Sprites\Adventurer"));
            this.settings.addSprite(TextureContent.LoadDictionaryContent <Texture2D>(this.game.Content, @"Graphics\Sprites\Female"));
            this.settings.addSprite(TextureContent.LoadDictionaryContent <Texture2D>(this.game.Content, @"Graphics\Sprites\Player"));
            this.settings.addSprite(TextureContent.LoadDictionaryContent <Texture2D>(this.game.Content, @"Graphics\Sprites\Soldier"));
            this.settings.addSprite(TextureContent.LoadDictionaryContent <Texture2D>(this.game.Content, @"Graphics\Sprites\Zombie"));

            this.settings.avaibleRamps       = TextureContent.LoadListContent <Texture2D>(this.game.Content, @"Graphics\Ramps");
            this.settings.avaibleBackgrounds = TextureContent.LoadListContent <Texture2D>(this.game.Content, @"Graphics\Backgrounds\ingame");

            // TEXTURES - MISC
            this.settings.textures.Add("hearth", this.game.Content.Load <Texture2D>(@"Graphics\hearth"));
            this.settings.textures.Add("star", this.game.Content.Load <Texture2D>(@"Graphics\star"));
            this.settings.textures.Add("sound.enabled", this.game.Content.Load <Texture2D>(@"Graphics\sound_enabled"));
            this.settings.textures.Add("sound.disabled", this.game.Content.Load <Texture2D>(@"Graphics\sound_disabled"));
            this.settings.textures.Add("vim-mode", this.game.Content.Load <Texture2D>(@"Graphics\vim_mode"));
            this.settings.textures.Add("logo", this.game.Content.Load <Texture2D>(@"Graphics\logo"));

            // SOUNDS
            this.settings.sounds.Add("menu.select", this.game.Content.Load <SoundEffect>(@"SFX\menu\menu_select"));
            this.settings.sounds.Add("menu.confirm", this.game.Content.Load <SoundEffect>(@"SFX\menu\menu_confirm"));

            this.settings.sounds.Add("game.jump.1", this.game.Content.Load <SoundEffect>(@"SFX\ingame\jump1"));
            this.settings.sounds.Add("game.jump.2", this.game.Content.Load <SoundEffect>(@"SFX\ingame\jump2"));
            this.settings.sounds.Add("game.jump.3", this.game.Content.Load <SoundEffect>(@"SFX\ingame\jump3"));
            this.settings.sounds.Add("game.jump.4", this.game.Content.Load <SoundEffect>(@"SFX\ingame\jump4"));

            this.settings.sounds.Add("game.death", this.game.Content.Load <SoundEffect>(@"SFX\ingame\death"));
            this.settings.sounds.Add("game.end", this.game.Content.Load <SoundEffect>(@"SFX\ingame\end"));

            // FONTS
            this.settings.fonts.Add("ingame", this.game.Content.Load <SpriteFont>(@"Fonts\ingameFont"));
            this.settings.fonts.Add("ingame.bigger", this.game.Content.Load <SpriteFont>(@"Fonts\biggerIngameFont"));
            this.settings.fonts.Add("menu.bigger", this.game.Content.Load <SpriteFont>(@"Fonts\biggerMenuFont"));
            this.settings.fonts.Add("paragraph", this.game.Content.Load <SpriteFont>(@"Fonts\paragraphFont"));

            Thread.Sleep(3000); // In case someone has NASA pc :D

            this.game.gameState = GameState.Menu;
        }
예제 #2
0
 public void LoadAllTextures(ContentManager content)
 {
     //Loads the Dictionary with all the item textures in ItemTextures folder
     projectileSpriteContent = TextureContent.LoadListContent <Texture2D>(content, "TextureSheets/ProjectileTextures");
 }
예제 #3
0
 public void LoadAllTextures(ContentManager content)
 {
     enemySpriteContent = TextureContent.LoadListContent <Texture2D>(content, "TextureSheets/EnemyTextures");
 }
예제 #4
0
        public void LoadAllGameObjects()
        {
            List <String> DirNames = new List <String> {
                "Interactables", "Grounds", "Rocks"
            };

            GameObjectFactory factory = new GameObjectFactory();

            foreach (String dirName in DirNames)
            {
                Dictionary <string, Texture2D> objectTextures = TextureContent.LoadListContent
                                                                <Texture2D>(_content, dirName);
                List <GameObject> ObjectTemplates = new List <GameObject>();

                GameObjectTextures.Add(dirName, objectTextures);

                foreach (var gameObj in objectTextures)
                {
                    // the type of the object to create is extracted from the
                    // sprite name
                    string objType = gameObj.Key.Split('/').Last();
                    // for more objects of the same type, the delimitor used is underscore
                    objType = objType.Split('_').First().ToLower();

                    Obj gobj = new Obj
                    {
                        Type       = objType,
                        Position   = Vector2.Zero,
                        SpriteSize = new Vector2(150, 100)
                    };

                    // don't add the key to the placeable gameObjects
                    if (objType == "key")
                    {
                        continue;
                    }

                    GameObject gameObject = factory.Create(gobj);
                    if (objType == "door")
                    {
                        (gameObject as Door).LockedLight.Texture   = GameObjectTextures["Misc"]["red_light"];
                        (gameObject as Door).UnlockedLight.Texture = GameObjectTextures["Misc"]["green_light"];
                    }
                    if (objType == "rockandhook")
                    {
                        (gameObject as RockHook).Rope.Texture       = GameObjectTextures["Misc"]["Rope"];
                        (gameObject as RockHook).Rope.SecondTexture = GameObjectTextures["Misc"]["Rope_transparent"];
                    }

                    if (objType == "platform")
                    {
                        (gameObject as Platform).Background.Texture = GameObjectTextures["Misc"]["platform_mechanismy"];
                    }
                    if (objType == "plankx")
                    {
                        continue;
                    }
                    if (objType == "planka")
                    {
                        continue;
                    }
                    if (objType == "plankbrope")
                    {
                        continue;
                    }
                    if (objType == "plankxrope")
                    {
                        continue;
                    }
                    if (objType == "plankpickaxe")
                    {
                        continue;
                    }
                    if (objType == "plankrb")
                    {
                        continue;
                    }
                    if (objType == "plankrt")
                    {
                        continue;
                    }
                    if (objType == "plankxrope")
                    {
                        continue;
                    }
                    if (objType == "plankkey")
                    {
                        continue;
                    }

                    gameObject.Texture = gameObj.Value;

                    //TODO: remove this ugly hardcoding
                    if (objType != "lever" && objType != "button")
                    {
                        ObjectTemplates.Add(gameObject);
                    }
                }

                CircularSelector circSelector = new CircularSelector(_content, dirName);
                circSelector.SetObjects(ObjectTemplates);
                ObjectsSelector.Add(dirName, circSelector);
            }
        }
예제 #5
0
 public void LoadMiscTextures()
 {
     GameObjectTextures.Add("Misc", TextureContent.LoadListContent <Texture2D>(_content, "Misc"));
 }