Exemplo n.º 1
0
        private void AddMainMenu()
        {
            var objects = new Dictionary <string, IObjectUi>();
            // рандомная штука для заглушки
            var background = new GameObjectUi <int>(0, false, false);

            background.LoadTexture(content, "textures/back_matmeh");
            objects.Add("background", background);
            // пока рандомный плеер для заглушки
            var mainMenu = new Scene(objects, new Player(""));

            scenes.Add(Scenes.MainMenu, mainMenu);
        }
Exemplo n.º 2
0
        private Dictionary <string, IObjectUi> GetUI()
        {
            var objects = new Dictionary <string, IObjectUi>();

            var uiSample = new GameObjectUi <GameObject>(null, false, true);

            uiSample.LoadTexture(content, "textures/Interface/leftUI");
            uiSample.Name        = "uiL";
            uiSample.Coordinates = new Vector2(0, 0);
            objects.Add("uiL", uiSample);

            var uiSample2 = new GameObjectUi <GameObject>(null, false, true);

            uiSample2.LoadTexture(content, "textures/Interface/rightUI");
            uiSample2.Name        = "uiR";
            uiSample2.Coordinates = new Vector2(game.Window.ClientBounds.Width - 200, 0);
            objects.Add("uiR", uiSample2);
            return(objects);
        }
Exemplo n.º 3
0
        private void AddHome()
        {
            // то же самое, но с локацией "home"
            var objects       = new Dictionary <string, IObjectUi>();
            var currentPlayer = GameUI.CurrentLogicalGame.Player;
            var playerUi      = new GameObjectUi <Player>(currentPlayer, false, false);

            //playerUi.LoadTexture(content, ...);
            //objects.Add(playerUi);
            foreach (var gameObj in GameUI.CurrentLogicalGame.Map.Home.Entities)
            {
                var background = new GameObjectUi <GameObject>(gameObj, true, false);
                //background.LoadTexture(content, $"textures/{gameObj.Name}");
                objects.Add(gameObj.Name, background);
            }
            var home = new Scene(objects, currentPlayer);

            scenes.Add(Scenes.Home, home);
        }
Exemplo n.º 4
0
        private void AddUniver()
        {
            // берем текущую игру, загружаем из локации "univer" все лог. объекты,
            // создаем для них граф. представление и закрепляем текстуру с соотв. именем
            var objects    = new Dictionary <string, IObjectUi>();
            var background = new GameObjectUi <GameObject>(null, false, false);

            background.LoadTexture(content, "textures/Univer/back_matmeh");
            background.Name        = "background";
            background.Coordinates = new Vector2(0, offsetY);
            objects.Add("background", background);
            foreach (var gameObj in GameUI.CurrentLogicalGame.Map.Univer.Entities)
            {
                var sprite = new GameObjectUi <GameObject>(gameObj, true, false);
                System.Console.WriteLine($"textures/{gameObj.Name}");
                sprite.LoadTexture(content, $"textures/Univer/{gameObj.Name}");
                sprite.LoadFlashedTexture(content, $"textures/Univer/{gameObj.Name}Enable");
                sprite.Name = gameObj.Name;
                objects.Add(gameObj.Name, sprite);
            }
            //добавим интерфейс
            var allObjects = objects.Union(GetUI()).ToDictionary(x => x.Key, x => x.Value);

            //добавим игрока
            var currentPlayer = GameUI.CurrentLogicalGame.Player;
            var playerUi      = new GameObjectUi <Player>(currentPlayer, false, false);

            playerUi.LoadTexture(content, "textures/Actor/gg_move/Right/GG_right");
            playerUi.Name = "player";
            allObjects.Add("player", playerUi);

            var univer = new Scene(allObjects, currentPlayer);

            //лучше заменить на добычу координат из xml как и путей до текстур
            PlaceObjectsOnScreenUniver(univer, offsetY);
            scenes.Add(Scenes.Univer, univer);
        }