Ejemplo n.º 1
0
        public void LoadContent(Content content, GraphicsDevice graphicsDevice)
        {
            statusPanel.Background = content.PanelBackground;
            screenComponent        = new ScreenComponent()
            {
                Background = content.MainBackground
            };
            screenComponent.Components.Add(startAsTester);
            screenComponent.Components.Add(teams);
            screenComponent.Components.Add(createMatch);
            screenComponent.Components.Add(joinMatch);
            screenComponent.Components.Add(myMatches);
            screenComponent.Components.Add(help);
            screenComponent.Components.Add(matchesPanel);
            screenComponent.Components.Add(helpPanel);
            screenComponent.Components.Add(statusPanel);

            helpPanel.Background = content.PanelBackground;
            helpPanel.Components.Add(new Text {
                Value = "Welcome to the MVP of GameThing!"
            });
            helpPanel.Components.Add(new Text {
                Value = "You play as a team of 5 characters."
            });
            helpPanel.Components.Add(new Text {
                Value = "Each character has a deck of 8 cards, with 4 cards in hand at a time."
            });
            helpPanel.Components.Add(new Text {
                Value = "Characters can play 2 cards and move 5 in their turn."
            });
            helpPanel.Components.Add(new Text {
                Value = "Once you play a card or move a character, you can't choose another this turn."
            });
            helpPanel.Components.Add(new Text {
                Value = "When you choose to be finished for a turn, press New Turn and your opponent will play."
            });
            helpPanel.Components.Add(new Text {
                Value = "After one side looses all characters, the other side wins!"
            });
            helpPanel.Components.Add(new Text {
                Value = "The MVP only has play versus another person and is turn-based."
            });

            screenComponent.OnGestureRead += ScreenComponent_GestureRead;
            screenComponent.LoadContent(content.ContentManager, graphicsDevice);

            battleManager.GetAvailableBattles().ContinueWith(task =>
            {
                availableBattles.AddRange(task.Result);
                SetDynamicButtons();
            });

            battleManager.GetMyBattles().ContinueWith(task => myBattles.AddRange(task.Result));
            backgroundLine = content.BackgroundLine;
        }
Ejemplo n.º 2
0
        public void LoadContent(Content content, GraphicsDevice graphicsDevice)
        {
            screenComponent = new ScreenComponent()
            {
                Background = content.MainBackground
            };
            screenComponent.Components.Add(createTeamButton);
            screenComponent.Components.Add(deleteTeamButton);
            screenComponent.Components.Add(backButton);
            screenComponent.Components.Add(teamPanel);
            screenComponent.LoadContent(content.ContentManager, graphicsDevice);

            backgroundLine = content.BackgroundLine;
        }
Ejemplo n.º 3
0
        public void LoadContent(Content content, GraphicsDevice graphicsDevice)
        {
            var map             = content.Map;
            var deploymentLayer = map.GetLayer <TiledMapObjectLayer>("Deployment");

            spaghettiDeployment = MapHelper.GetObjectRectangleInMapPoints(deploymentLayer.Objects.SingleOrDefault(deployment => deployment.Name.Equals("Spaghetti")));
            unicornDeployment   = MapHelper.GetObjectRectangleInMapPoints(deploymentLayer.Objects.SingleOrDefault(deployment => deployment.Name.Equals("Unicorn")));
            MapHelper.Map       = map;
            MapHelper.Entities  = entities;

            entities.Add(new Terrain(content.MediumTree, new MapPoint(3, 4)));
            entities.Add(new Terrain(content.MediumTree, new MapPoint(17, 21)));
            entities.Add(new Terrain(content.MediumTree, new MapPoint(23, 2)));
            entities.Add(new Terrain(content.MediumTree, new MapPoint(6, 15)));
            entities.Add(new Terrain(content.SmallTree, new MapPoint(15, 20)));
            entities.Add(new Terrain(content.SmallTree, new MapPoint(19, 22)));
            entities.Add(new Terrain(content.SmallTree, new MapPoint(6, 16)));
            entities.Add(new Terrain(content.SmallTree, new MapPoint(6, 14)));
            entities.Add(new Terrain(content.SmallTree, new MapPoint(28, 20)));
            entities.Add(new Terrain(content.SmallTree, new MapPoint(24, 25)));
            entities.Add(new Terrain(content.LargeBush, new MapPoint(26, 6)));
            entities.Add(new Terrain(content.LargeBush, new MapPoint(16, 10)));
            entities.Add(new Terrain(content.LargeBush, new MapPoint(1, 20)));

            mapRenderer = new TiledMapRenderer(graphicsDevice, map);
            camera      = new OrthographicCamera(graphicsDevice);
            camera.LookAt(new Vector2(0, map.HeightInPixels / 2));              // center the map in the screen

            selectedPlayerStatsPanel.Background = content.PanelBackground;
            selectedPlayerStatsPanel.Components.Add(playerClassText);
            selectedPlayerStatsPanel.Components.Add(sideText);
            selectedPlayerStatsPanel.Components.Add(healthText);
            selectedPlayerStatsPanel.Components.Add(strAgiText);
            selectedPlayerStatsPanel.Components.Add(intStaText);
            selectedPlayerStatsPanel.Components.Add(evdDefText);
            selectedPlayerStatsPanel.Components.Add(deckText);
            selectedPlayerStatsPanel.Components.Add(playsMovesText);
            selectedPlayerStatsPanel.Components.Add(appliedConditionRow);
            conditionIcons           = content.ConditionIcons;
            SelectedCharacterChange += UpdateSelectedCharacterPanel;

            playerSidePanel.Background = content.PanelBackground;
            playerSidePanel.Components.Add(playerSideText);

            gameLogPanel.Background = content.PanelBackground;

            spaghettiHatIcon = content.SpaghettiHatIcon;
            unicornHatIcon   = content.UnicornHatIcon;
            moveIcon         = content.MoveIcon;
            cardIcon         = content.CardIcon;
            heldGameLogEntryPanel.Background = content.PanelBackground;
            heldGameLogEntryPanel.Components.Add(heldGameLogSource);
            heldGameLogEntryPanel.Components.Add(heldGameLogTarget);
            heldGameLogEntryPanel.Components.Add(heldGameLogActionText);

            appliedConditionDetailsPanel.Background = content.PanelBackground;
            appliedConditionDetailsPanel.Components.Add(appliedConditionDetailsText);

            statusPanel.Background         = content.PanelBackground;
            screenComponent                = new ScreenComponent();
            screenComponent.OnGestureRead += ScreenComponent_GestureRead;
            screenComponent.Components.Add(endTurnButton);
            screenComponent.Components.Add(winGameNowButton);
            screenComponent.Components.Add(selectedPlayerStatsPanel);
            screenComponent.Components.Add(gameLogPanel);
            screenComponent.Components.Add(playerSidePanel);
            screenComponent.Components.Add(heldGameLogEntryPanel);
            screenComponent.Components.Add(appliedConditionDetailsPanel);
            screenComponent.Components.Add(statusPanel);
            screenComponent.LoadContent(content.ContentManager, graphicsDevice);

            this.content        = content;
            handOfCards.Content = content;

            renderTarget = new RenderTarget2D(graphicsDevice, graphicsDevice.Viewport.Width, graphicsDevice.Viewport.Height, false, SurfaceFormat.Color, DepthFormat.None);
        }