private void ShowControls()
        {
            int yStart = 10 + GlobalValues.FontYSpacer;

            LinkedList <Vector2> turn   = MyFont.GetWord(GlobalValues.FontScaleSize, "Arrow keys or A:D to rotate");
            LinkedList <Vector2> thrust = MyFont.GetWord(GlobalValues.FontScaleSize, "W:Space:Up Arrow to thrust");
            LinkedList <Vector2> pause  = MyFont.GetWord(GlobalValues.FontScaleSize, "P:ESC to pause");

            Vector2 turnPosition   = new Vector2(GlobalValues.GetWordCenterPos("Arrow keys or A:D to rotate", false).X, yStart);
            Vector2 thrustPosition = new Vector2(GlobalValues.GetWordCenterPos("W:Space:Up Arrow to thrust", false).X, yStart + GlobalValues.FontYSpacer);
            Vector2 pausePosition  = new Vector2(GlobalValues.GetWordCenterPos("P:ESC to pause", false).X, yStart + (GlobalValues.FontYSpacer * 2));

            foreach (Vector2 v2 in turn)
            {
                pb.AddVertex(v2 + turnPosition, Color.White);
            }

            foreach (Vector2 v2 in thrust)
            {
                pb.AddVertex(v2 + thrustPosition, Color.White);
            }

            foreach (Vector2 v2 in pause)
            {
                pb.AddVertex(v2 + pausePosition, Color.White);
            }
        }
        public override void Draw(GameTime gameTime)
        {
            LinkedList <Vector2> screenTitle = MyFont.GetWord(GlobalValues.TitleFontScaleSize, "Splash Screen");
            Vector2 screenTitlePos           = GlobalValues.GetWordCenterPos("Splash Screen", true);

            if (GlobalValues.ValuesInitialized)
            {
                if (spriteBatch != null)
                {
                    spriteBatch.Begin();

                    spriteBatch.Draw(myImage, new Vector2(0, 0));

                    spriteBatch.End();
                }

                if (pb != null)
                {
                    pb.Begin(PrimitiveType.LineList);

                    DrawLander();
                    DrawLanderRocket();
                    DisplayKeys();

                    pb.End();
                }
                else
                {
                    pb = GlobalValues.PrimitiveBatch;
                }
            }
        }
Exemple #3
0
        private void ShowConfirmationOptions()
        {
            float yStart = (GlobalValues.ScreenCenter.Y - (GlobalValues.FontYSpacer * 5));

            LinkedList <Vector2> areYouSure = MyFont.GetWord(GlobalValues.FontScaleSize, $"Are you sure you want to delete {mapNames[oldSelectedItem - 1]}");
            LinkedList <Vector2> yesOption  = MyFont.GetWord(GlobalValues.FontScaleSize, "Yes");
            LinkedList <Vector2> noOption   = MyFont.GetWord(GlobalValues.FontScaleSize, "No");

            Vector2 areYouSurePos = new Vector2(GlobalValues.GetWordCenterPos($"Are you sure you want to delete {mapNames[oldSelectedItem - 1]}", false).X, yStart);
            Vector2 yesOptionPos  = new Vector2(GlobalValues.GetWordCenterPos("Yes", false).X, yStart + (GlobalValues.FontYSpacer * 5));
            Vector2 noOptionPos   = new Vector2(GlobalValues.GetWordCenterPos("No", false).X, yStart + (GlobalValues.FontYSpacer * 6));

            foreach (Vector2 v2 in areYouSure)
            {
                pb.AddVertex(v2 + areYouSurePos, Color.White);
            }

            foreach (Vector2 v2 in yesOption)
            {
                pb.AddVertex(v2 + yesOptionPos, Color.White);
            }

            foreach (Vector2 v2 in noOption)
            {
                pb.AddVertex(v2 + noOptionPos, Color.White);
            }

            List <Vector2> positions = new List <Vector2>()
            {
                yesOptionPos, noOptionPos
            };

            ShowSelectedIcon(positions);
        }
        private void ShowKeys()
        {
            LinkedList <Vector2> display = MyFont.GetWord(GlobalValues.FontScaleSize, "Press ESC to return to Main Menu");
            Vector2 displayPos           = GlobalValues.GetWordCenterPos("Press ESC to return to Main Menu", false) + new Vector2(0, 325);

            foreach (Vector2 v2 in display)
            {
                pb.AddVertex(v2 + displayPos, Color.White);
            }
        }
        private void ShowTitle()
        {
            LinkedList <Vector2> title = MyFont.GetWord(GlobalValues.FontScaleSize, "Lunar Lander");
            Vector2 titlePosition      = new Vector2(GlobalValues.GetWordCenterPos("Lunar Lander", false).X, 10);

            foreach (Vector2 v2 in title)
            {
                pb.AddVertex(v2 + titlePosition, Color.White);
            }
        }
        private void DisplayKeys()
        {
            LinkedList <Vector2> display = MyFont.GetWord(GlobalValues.FontScaleSize, $"Press Space to continue or wait {5 - elapsedTime.Seconds} seconds");
            Vector2 displayPos           = new Vector2(GlobalValues.GetWordCenterPos("Press Space to continue or wait 5 seconds", false).X, 270);

            foreach (Vector2 v2 in display)
            {
                pb.AddVertex(v2 + displayPos, Color.Red);
            }
        }
Exemple #7
0
        private void ShowMenuOptions()
        {
            LinkedList <Vector2> screenTitle   = MyFont.GetWord(GlobalValues.TitleFontScaleSize, "Main Menu");
            LinkedList <Vector2> playOption    = MyFont.GetWord(GlobalValues.FontScaleSize, "Play");
            LinkedList <Vector2> optionsOption = MyFont.GetWord(GlobalValues.FontScaleSize, "Options");
            LinkedList <Vector2> creatorOption = MyFont.GetWord(GlobalValues.FontScaleSize, "Map Creator");
            LinkedList <Vector2> creditsOption = MyFont.GetWord(GlobalValues.FontScaleSize, "Credits");
            LinkedList <Vector2> exitOption    = MyFont.GetWord(GlobalValues.FontScaleSize, "Exit");

            Vector2 screenTitlePos   = new Vector2(GlobalValues.GetWordCenterPos("Main Menu", true).X, 100);
            Vector2 playOptionPos    = new Vector2(GlobalValues.GetWordCenterPos("Play", false).X, GlobalValues.ScreenCenter.Y - GlobalValues.FontYSpacer);
            Vector2 optionsOptionPos = new Vector2(GlobalValues.GetWordCenterPos("Options", false).X, GlobalValues.ScreenCenter.Y);
            Vector2 creatorOptionPos = new Vector2(GlobalValues.GetWordCenterPos("Map Creator", false).X, GlobalValues.ScreenCenter.Y + GlobalValues.FontYSpacer);
            Vector2 creditsOptionPos = new Vector2(GlobalValues.GetWordCenterPos("Credits", false).X, GlobalValues.ScreenCenter.Y + (GlobalValues.FontYSpacer * 2));
            Vector2 exitOptionPos    = new Vector2(GlobalValues.GetWordCenterPos("Exit", false).X, GlobalValues.ScreenCenter.Y + (GlobalValues.FontYSpacer * 3));

            List <Vector2> positions = new List <Vector2>()
            {
                playOptionPos, optionsOptionPos, creatorOptionPos, creditsOptionPos, exitOptionPos
            };

            ShowSelectedIcon(positions);

            #region Foreach
            foreach (Vector2 v2 in screenTitle)
            {
                pb.AddVertex(v2 + screenTitlePos, Color.White);
            }

            foreach (Vector2 v2 in playOption)
            {
                pb.AddVertex(v2 + playOptionPos, Color.White);
            }

            foreach (Vector2 v2 in optionsOption)
            {
                pb.AddVertex(v2 + optionsOptionPos, Color.White);
            }

            foreach (Vector2 v2 in creatorOption)
            {
                pb.AddVertex(v2 + creatorOptionPos, Color.White);
            }

            foreach (Vector2 v2 in creditsOption)
            {
                pb.AddVertex(v2 + creditsOptionPos, Color.White);
            }

            foreach (Vector2 v2 in exitOption)
            {
                pb.AddVertex(v2 + exitOptionPos, Color.White);
            }
            #endregion
        }
        private void ShowGUIWords()
        {
            int xLeftSide  = 10;
            int xRightSide = 1000;
            int yStart     = 20;

            LinkedList <Vector2> score     = MyFont.GetWord(GlobalValues.FontScaleSize, "Score");
            LinkedList <Vector2> time      = MyFont.GetWord(GlobalValues.FontScaleSize, "Time");
            LinkedList <Vector2> fuel      = MyFont.GetWord(GlobalValues.FontScaleSize, "Fuel");
            LinkedList <Vector2> rotation  = MyFont.GetWord(GlobalValues.FontScaleSize, "Rotation");
            LinkedList <Vector2> xVelocity = MyFont.GetWord(GlobalValues.FontScaleSize, "X Velocity");
            LinkedList <Vector2> yVelocity = MyFont.GetWord(GlobalValues.FontScaleSize, "Y Velocity");

            Vector2 scorePosition     = new Vector2(xLeftSide, yStart);
            Vector2 timePosition      = new Vector2(xLeftSide, yStart + GlobalValues.FontYSpacer);
            Vector2 fuelPosition      = new Vector2(xLeftSide, yStart + (GlobalValues.FontYSpacer * 2));
            Vector2 rotationPosition  = new Vector2(xRightSide, yStart);
            Vector2 xVelocityPosition = new Vector2(xRightSide, yStart + GlobalValues.FontYSpacer);
            Vector2 yVelocityPosition = new Vector2(xRightSide, yStart + (GlobalValues.FontYSpacer * 2));

            foreach (Vector2 v2 in score)
            {
                pb.AddVertex(v2 + scorePosition, Color.White);
            }

            foreach (Vector2 v2 in time)
            {
                pb.AddVertex(v2 + timePosition, Color.White);
            }

            foreach (Vector2 v2 in fuel)
            {
                pb.AddVertex(v2 + fuelPosition, Color.White);
            }

            foreach (Vector2 v2 in xVelocity)
            {
                pb.AddVertex(v2 + xVelocityPosition, Color.White);
            }

            foreach (Vector2 v2 in rotation)
            {
                pb.AddVertex(v2 + rotationPosition, Color.White);
            }

            foreach (Vector2 v2 in yVelocity)
            {
                pb.AddVertex(v2 + yVelocityPosition, Color.White);
            }
        }
        private void ShowControls()
        {
            float yStart = 500;

            LinkedList <Vector2> leave = MyFont.GetWord(GlobalValues.FontScaleSize, "Press escape to return to options screen.");

            Vector2 leavePos = new Vector2(GlobalValues.GetWordCenterPos("Press escape to return to options screen.", false).X, yStart);

            #region Foreach
            foreach (Vector2 v2 in leave)
            {
                pb.AddVertex(v2 + leavePos, Color.White);
            }
            #endregion
        }
Exemple #10
0
        private void ShowMenuOptions()
        {
            float yStart = (GlobalValues.ScreenCenter.Y - (GlobalValues.FontYSpacer * 2));

            LinkedList <Vector2> screenTitle    = MyFont.GetWord(GlobalValues.TitleFontScaleSize, "Map Manager");
            LinkedList <Vector2> mainMenuOption = MyFont.GetWord(GlobalValues.FontScaleSize, "Main Menu");

            Vector2 screenTitlePos    = new Vector2(GlobalValues.GetWordCenterPos("Map Manager", true).X, 100);
            Vector2 mainMenuOptionPos = new Vector2(GlobalValues.GetWordCenterPos("Main Menu", false).X, GlobalValues.ScreenCenter.Y - (GlobalValues.FontYSpacer * 3));

            foreach (Vector2 v2 in screenTitle)
            {
                pb.AddVertex(v2 + screenTitlePos, Color.White);
            }

            foreach (Vector2 v2 in mainMenuOption)
            {
                pb.AddVertex(v2 + mainMenuOptionPos, Color.White);
            }

            LinkedList <Vector2> option = new LinkedList <Vector2>();
            Vector2 optionPos           = new Vector2();

            List <Vector2> positions = new List <Vector2>()
            {
                mainMenuOptionPos
            };

            int mapNum = 0;

            foreach (string map in mapNames)
            {
                option    = MyFont.GetWord(GlobalValues.FontScaleSize, map);
                optionPos = new Vector2(GlobalValues.GetWordCenterPos(map, false).X, yStart + (GlobalValues.FontYSpacer * mapNum));

                foreach (Vector2 v2 in option)
                {
                    pb.AddVertex(v2 + optionPos, Color.White);
                }

                positions.Add(optionPos);

                mapNum++;
            }

            ShowSelectedIcon(positions);
        }
        private void ShowMenuOptions()
        {
            float xPos   = GlobalValues.ScreenCenter.X - ("Restart".Length * (GlobalValues.FontScaleSize * 2));
            float yStart = GlobalValues.ScreenCenter.Y;

            LinkedList <Vector2> screenTitle    = MyFont.GetWord(GlobalValues.TitleFontScaleSize, "Pause");
            LinkedList <Vector2> continueOption = MyFont.GetWord(GlobalValues.FontScaleSize, "Continue");
            LinkedList <Vector2> restartOption  = MyFont.GetWord(GlobalValues.FontScaleSize, "Restart");
            LinkedList <Vector2> mainMenuOption = MyFont.GetWord(GlobalValues.FontScaleSize, "Main Menu");

            Vector2 screenTitlePos    = new Vector2(GlobalValues.GetWordCenterPos("Pause", true).X, 100);
            Vector2 continueOptionPos = new Vector2(GlobalValues.GetWordCenterPos("Continue", false).X, GlobalValues.ScreenCenter.Y - GlobalValues.FontYSpacer);
            Vector2 restartOptionPos  = new Vector2(GlobalValues.GetWordCenterPos("Restart", false).X, GlobalValues.ScreenCenter.Y);
            Vector2 mainMenuOptionPos = new Vector2(GlobalValues.GetWordCenterPos("Main Menu", false).X, GlobalValues.ScreenCenter.Y + GlobalValues.FontYSpacer);

            List <Vector2> positions = new List <Vector2>()
            {
                continueOptionPos, restartOptionPos, mainMenuOptionPos
            };

            ShowSelectedIcon(positions);

            #region Foreach
            foreach (Vector2 v2 in screenTitle)
            {
                pb.AddVertex(v2 + screenTitlePos, Color.White);
            }

            foreach (Vector2 v2 in continueOption)
            {
                pb.AddVertex(v2 + continueOptionPos, Color.White);
            }

            foreach (Vector2 v2 in restartOption)
            {
                pb.AddVertex(v2 + restartOptionPos, Color.White);
            }

            foreach (Vector2 v2 in mainMenuOption)
            {
                pb.AddVertex(v2 + mainMenuOptionPos, Color.White);
            }
            #endregion
        }
Exemple #12
0
        private void ShowMenu()
        {
            LinkedList <Vector2> screenTitle   = MyFont.GetWord(GlobalValues.TitleFontScaleSize, "Volume");
            LinkedList <Vector2> currentVolume = MyFont.GetWord(GlobalValues.FontScaleSize, (volume * 100).ToString());

            Vector2 screenTitlePos   = new Vector2(GlobalValues.GetWordCenterPos("Volume", true).X, 100);
            Vector2 currentVolumePos = new Vector2(GlobalValues.GetWordCenterPos((volume * 100).ToString(), false).X, GlobalValues.ScreenCenter.Y);

            #region Foreach
            foreach (Vector2 v2 in screenTitle)
            {
                pb.AddVertex(v2 + screenTitlePos, Color.White);
            }

            foreach (Vector2 v2 in currentVolume)
            {
                pb.AddVertex(v2 + currentVolumePos, Color.White);
            }
            #endregion
        }
        private void ShowMenu()
        {
            LinkedList <Vector2> screenTitle    = MyFont.GetWord(GlobalValues.TitleFontScaleSize, "Resolution");
            LinkedList <Vector2> notImplemented = MyFont.GetWord(GlobalValues.FontScaleSize, "Not implemented");

            Vector2 screenTitlePos    = new Vector2(GlobalValues.GetWordCenterPos("Resolution", true).X, 100);
            Vector2 notImplementedPos = new Vector2(GlobalValues.GetWordCenterPos("Not implemented", false).X, GlobalValues.ScreenCenter.Y);

            #region Foreach
            foreach (Vector2 v2 in screenTitle)
            {
                pb.AddVertex(v2 + screenTitlePos, Color.White);
            }

            foreach (Vector2 v2 in notImplemented)
            {
                pb.AddVertex(v2 + notImplementedPos, Color.White);
            }
            #endregion
        }
        public override void Draw(GameTime gameTime)
        {
            LinkedList <Vector2> screenTitle = MyFont.GetWord(GlobalValues.TitleFontScaleSize, "Credits");
            LinkedList <Vector2> credits     = MyFont.GetWord(GlobalValues.FontScaleSize, "Created by: Steven Endres");

            Vector2 screenTitlePos = new Vector2(GlobalValues.GetWordCenterPos("Credits", true).X, 100);
            Vector2 creditsPos     = new Vector2(GlobalValues.GetWordCenterPos("Created By: Steven Endres", false).X, GlobalValues.ScreenCenter.Y);

            pb.Begin(PrimitiveType.LineList);

            foreach (Vector2 v2 in screenTitle)
            {
                pb.AddVertex(v2 + screenTitlePos, Color.White);
            }

            foreach (Vector2 v2 in credits)
            {
                pb.AddVertex(v2 + creditsPos, Color.White);
            }

            ShowKeys();

            pb.End();
        }
        public override void Draw(GameTime gameTime)
        {
            LinkedList <Vector2> screenTitle = MyFont.GetWord(GlobalValues.TitleFontScaleSize, "Studio Screen");
            Vector2 screenTitlePos           = GlobalValues.GetWordCenterPos("Studio Screen", true);

            spriteBatch.Begin();

            spriteBatch.Draw(myImage, new Vector2(275, 0));

            spriteBatch.End();

            pb.Begin(PrimitiveType.LineList);

            //foreach (Vector2 v2 in screenTitle)
            //{
            //    pb.AddVertex(v2 + screenTitlePos, Color.White);
            //}



            DisplayKeys();

            pb.End();
        }
Exemple #16
0
        private void ShowControls()
        {
            float yStart = 500;

            LinkedList <Vector2> leftRight = MyFont.GetWord(GlobalValues.FontScaleSize, "Use left:right arrow keys or a:d to change volume");
            LinkedList <Vector2> amounts   = MyFont.GetWord(GlobalValues.FontScaleSize, "hold control to change by 10 or shift to change by 5");
            LinkedList <Vector2> leave     = MyFont.GetWord(GlobalValues.FontScaleSize, "press escape to leave without saving changes");
            LinkedList <Vector2> confirm   = MyFont.GetWord(GlobalValues.FontScaleSize, "press enter to update volume");

            Vector2 leftRightPos = new Vector2(GlobalValues.GetWordCenterPos("Use left:right arrow keys or a:d to change volume", false).X, yStart);
            Vector2 amountsPos   = new Vector2(GlobalValues.GetWordCenterPos("hold control to change by 10 or shift to change by 5", false).X, yStart + GlobalValues.FontYSpacer);
            Vector2 leavePos     = new Vector2(GlobalValues.GetWordCenterPos("press escape to leave without saving changes", false).X, yStart + (GlobalValues.FontYSpacer * 2));
            Vector2 confirmPos   = new Vector2(GlobalValues.GetWordCenterPos("press enter to update volume", false).X, yStart + (GlobalValues.FontYSpacer * 3));

            #region Foreach
            foreach (Vector2 v2 in leftRight)
            {
                pb.AddVertex(v2 + leftRightPos, Color.White);
            }

            foreach (Vector2 v2 in amounts)
            {
                pb.AddVertex(v2 + amountsPos, Color.White);
            }

            foreach (Vector2 v2 in leave)
            {
                pb.AddVertex(v2 + leavePos, Color.White);
            }

            foreach (Vector2 v2 in confirm)
            {
                pb.AddVertex(v2 + confirmPos, Color.White);
            }
            #endregion
        }
Exemple #17
0
        private void ShowGUINumbers()
        {
            int xLeftSide  = 10 + ((("Score".Length + 1) * 6) * (GlobalValues.FontScaleSize));
            int xRightSide = 1025 + ((("Rotation".Length + 1) * 6) * (GlobalValues.FontScaleSize));
            int yStart     = 20;

            #region Score
            string scoreDisplay = "";
            for (int i = 1; i <= (4 - LanderValues.PlayerScore.ToString().Length); i++)
            {
                scoreDisplay += "0";
            }

            scoreDisplay += LanderValues.PlayerScore.ToString();
            LinkedList <Vector2> score = MyFont.GetWord(GlobalValues.FontScaleSize, scoreDisplay);
            Vector2 scorePosition      = new Vector2(xLeftSide, yStart);

            foreach (Vector2 v2 in score)
            {
                pb.AddVertex(v2 + scorePosition, Color.White);
            }
            #endregion

            #region Time
            string timeDisplay = "";

            for (int i = 1; i <= (2 - LanderValues.GameTime.Minutes.ToString().Length); i++)
            {
                timeDisplay += "0";
            }

            timeDisplay += LanderValues.GameTime.Minutes.ToString() + ":";

            for (int i = 1; i <= (2 - LanderValues.GameTime.Seconds.ToString().Length); i++)
            {
                timeDisplay += "0";
            }

            timeDisplay += LanderValues.GameTime.Seconds.ToString();
            LinkedList <Vector2> time = MyFont.GetWord(GlobalValues.FontScaleSize, timeDisplay);
            Vector2 timePosition      = new Vector2(xLeftSide, yStart + GlobalValues.FontYSpacer);

            foreach (Vector2 v2 in time)
            {
                pb.AddVertex(v2 + timePosition, Color.White);
            }
            #endregion

            #region Fuel
            string fuelDisplay = "";

            for (int i = 1; i <= (3 - LanderValues.FuelRemaining.ToString().Length); i++)
            {
                fuelDisplay += "0";
            }

            fuelDisplay += LanderValues.FuelRemaining.ToString();

            LinkedList <Vector2> fuel = MyFont.GetWord(GlobalValues.FontScaleSize, fuelDisplay);
            Vector2 fuelPosition      = new Vector2(xLeftSide, yStart + (GlobalValues.FontYSpacer * 2));

            foreach (Vector2 v2 in fuel)
            {
                pb.AddVertex(v2 + fuelPosition, Color.White);
            }
            #endregion

            #region Rotation
            string rotationDisplay = "";
            float  degreesRotation = LanderValues.Rotation;

            if (degreesRotation < 0)
            {
                degreesRotation *= -1;
            }

            degreesRotation = (float)Math.Round(MathHelper.ToDegrees(degreesRotation));

            if (degreesRotation >= 360)
            {
                int numOf360 = (int)degreesRotation / 360;
                degreesRotation -= (float)360 * numOf360;
            }

            if (degreesRotation <= 9)
            {
                rotationDisplay  = "00";
                rotationDisplay += degreesRotation.ToString();
            }
            else if (degreesRotation <= 99 && degreesRotation > 9)
            {
                rotationDisplay  = "0";
                rotationDisplay += degreesRotation.ToString();
            }
            else
            {
                rotationDisplay = degreesRotation.ToString();
            }

            LinkedList <Vector2> rotation = MyFont.GetWord(GlobalValues.FontScaleSize, rotationDisplay);
            Vector2 rotationPosition      = new Vector2(xRightSide, yStart);

            foreach (Vector2 v2 in rotation)
            {
                pb.AddVertex(v2 + rotationPosition, Color.White);
            }
            #endregion

            #region X Velocity
            float xVelocityNum = (float)Math.Round(LanderValues.Velocity.X * LanderValues.VelocityScale);

            if (xVelocityNum < 0)
            {
                xVelocityNum *= -1;
            }

            string xVelocityDisplay = "";

            for (int i = 1; i <= (3 - xVelocityNum.ToString().Length); i++)
            {
                xVelocityDisplay += "0";
            }

            xVelocityDisplay += xVelocityNum.ToString();

            LinkedList <Vector2> xVelocity = MyFont.GetWord(GlobalValues.FontScaleSize, xVelocityDisplay);
            Vector2 xVelocityPosition      = new Vector2(xRightSide, yStart + GlobalValues.FontYSpacer);

            foreach (Vector2 v2 in xVelocity)
            {
                pb.AddVertex(v2 + xVelocityPosition, Color.White);
            }
            #endregion

            #region Y Velocity
            float yVelocityNum = (float)Math.Round(LanderValues.Velocity.Y * LanderValues.VelocityScale);

            if (yVelocityNum < 0)
            {
                yVelocityNum *= -1;
            }

            string yVelocityDisplay = "";

            for (int i = 1; i <= (3 - yVelocityNum.ToString().Length); i++)
            {
                yVelocityDisplay += "0";
            }

            yVelocityDisplay += yVelocityNum.ToString();

            LinkedList <Vector2> yVelocity = MyFont.GetWord(GlobalValues.FontScaleSize, yVelocityDisplay);
            Vector2 yVelocityPosition      = new Vector2(xRightSide, yStart + (GlobalValues.FontYSpacer * 2));

            foreach (Vector2 v2 in yVelocity)
            {
                pb.AddVertex(v2 + yVelocityPosition, Color.White);
            }
            #endregion
        }
Exemple #18
0
        private void ShowMenuOptions()
        {
            LinkedList <Vector2> screenTitle    = MyFont.GetWord(GlobalValues.TitleFontScaleSize, "Options");
            LinkedList <Vector2> mainMenuOption = MyFont.GetWord(GlobalValues.FontScaleSize, "Main Menu");
            LinkedList <Vector2> option1Option  = MyFont.GetWord(GlobalValues.FontScaleSize, "Manage Maps");
            LinkedList <Vector2> option2Option  = MyFont.GetWord(GlobalValues.FontScaleSize, "Change Volume");
            LinkedList <Vector2> option3Option  = MyFont.GetWord(GlobalValues.FontScaleSize, "Change Resolution");
            LinkedList <Vector2> option4Option  = MyFont.GetWord(GlobalValues.FontScaleSize, "Change Difficulty");
            LinkedList <Vector2> option5Option  = MyFont.GetWord(GlobalValues.FontScaleSize, "Change Gravity");

            Vector2 screenTitlePos    = new Vector2(GlobalValues.GetWordCenterPos("Options", true).X, 100);
            Vector2 mainMenuOptionPos = new Vector2(GlobalValues.GetWordCenterPos("Main Menu", false).X, GlobalValues.ScreenCenter.Y - (GlobalValues.FontYSpacer * 2));
            Vector2 option1OptionPos  = new Vector2(GlobalValues.GetWordCenterPos("Manage Maps", false).X, GlobalValues.ScreenCenter.Y - GlobalValues.FontYSpacer);
            Vector2 option2OptionPos  = new Vector2(GlobalValues.GetWordCenterPos("Change Volume", false).X, GlobalValues.ScreenCenter.Y);
            Vector2 option3OptionPos  = new Vector2(GlobalValues.GetWordCenterPos("Change Resolution", false).X, GlobalValues.ScreenCenter.Y + GlobalValues.FontYSpacer);
            Vector2 option4OptionPos  = new Vector2(GlobalValues.GetWordCenterPos("Change Difficulty", false).X, GlobalValues.ScreenCenter.Y + (GlobalValues.FontYSpacer * 2));
            Vector2 option5OptionPos  = new Vector2(GlobalValues.GetWordCenterPos("Change Gravity", false).X, GlobalValues.ScreenCenter.Y + (GlobalValues.FontYSpacer * 3));

            List <Vector2> positions = new List <Vector2>()
            {
                mainMenuOptionPos, option1OptionPos, option2OptionPos, option3OptionPos, option4OptionPos, option5OptionPos
            };

            ShowSelectedIcon(positions);

            #region Foreach
            foreach (Vector2 v2 in screenTitle)
            {
                pb.AddVertex(v2 + screenTitlePos, Color.White);
            }

            foreach (Vector2 v2 in mainMenuOption)
            {
                pb.AddVertex(v2 + mainMenuOptionPos, Color.White);
            }

            foreach (Vector2 v2 in option1Option)
            {
                pb.AddVertex(v2 + option1OptionPos, Color.White);
            }

            foreach (Vector2 v2 in option2Option)
            {
                pb.AddVertex(v2 + option2OptionPos, Color.White);
            }

            foreach (Vector2 v2 in option3Option)
            {
                pb.AddVertex(v2 + option3OptionPos, Color.White);
            }

            foreach (Vector2 v2 in option4Option)
            {
                pb.AddVertex(v2 + option4OptionPos, Color.White);
            }

            foreach (Vector2 v2 in option5Option)
            {
                pb.AddVertex(v2 + option5OptionPos, Color.White);
            }
            #endregion
        }
Exemple #19
0
        private void Display()
        {
            float xLeft  = 25;
            int   yStart = 25;

            #region Linked Lists
            LinkedList <Vector2> screenTitle    = MyFont.GetWord(GlobalValues.FontScaleSize, "Map Creator");
            LinkedList <Vector2> togglePads     = MyFont.GetWord(GlobalValues.FontScaleSize, "Toggle pads: P");
            LinkedList <Vector2> saveMap        = MyFont.GetWord(GlobalValues.FontScaleSize, "Save Map: S");
            LinkedList <Vector2> exit           = MyFont.GetWord(GlobalValues.FontScaleSize, "Exit: ESC");
            LinkedList <Vector2> arePadsToggled = MyFont.GetWord(GlobalValues.FontScaleSize, $"Pads Toggled: {makingPads}");
            LinkedList <Vector2> isMapSaved     = MyFont.GetWord(GlobalValues.FontScaleSize, $"Map Saved: {isSaved}");
            LinkedList <Vector2> currentX       = MyFont.GetWord(GlobalValues.FontScaleSize, $"Current X Pos: {newMouseState.X}");
            LinkedList <Vector2> currentY       = MyFont.GetWord(GlobalValues.FontScaleSize, $"Current Y Pos: {newMouseState.Y}");
            #endregion

            #region Positions
            Vector2 screenTitlePos    = new Vector2(xLeft, yStart);
            Vector2 togglePadsPos     = new Vector2(xLeft, yStart + GlobalValues.FontYSpacer);
            Vector2 saveMapPos        = new Vector2(xLeft, yStart + (GlobalValues.FontYSpacer * 2));
            Vector2 exitPos           = new Vector2(xLeft, yStart + (GlobalValues.FontYSpacer * 3));
            Vector2 arePadsToggledPos = new Vector2(xLeft, yStart + (GlobalValues.FontYSpacer * 4));
            Vector2 isMapSavedPos     = new Vector2(xLeft, yStart + (GlobalValues.FontYSpacer * 5));
            Vector2 currentXPos       = new Vector2(xLeft, yStart + (GlobalValues.FontYSpacer * 6));
            Vector2 currentYPos       = new Vector2(xLeft, yStart + (GlobalValues.FontYSpacer * 7));
            #endregion

            #region Foreach
            foreach (Vector2 v2 in screenTitle)
            {
                pb.AddVertex(v2 + screenTitlePos, Color.White);
            }

            foreach (Vector2 v2 in togglePads)
            {
                pb.AddVertex(v2 + togglePadsPos, Color.White);
            }

            foreach (Vector2 v2 in saveMap)
            {
                pb.AddVertex(v2 + saveMapPos, Color.White);
            }

            foreach (Vector2 v2 in exit)
            {
                pb.AddVertex(v2 + exitPos, Color.White);
            }

            foreach (Vector2 v2 in arePadsToggled)
            {
                pb.AddVertex(v2 + arePadsToggledPos, Color.White);
            }

            foreach (Vector2 v2 in isMapSaved)
            {
                pb.AddVertex(v2 + isMapSavedPos, Color.White);
            }

            foreach (Vector2 v2 in currentX)
            {
                pb.AddVertex(v2 + currentXPos, Color.White);
            }

            foreach (Vector2 v2 in currentY)
            {
                pb.AddVertex(v2 + currentYPos, Color.White);
            }
            #endregion
        }
Exemple #20
0
        public override void Draw(GameTime gameTime)
        {
            pb.Begin(PrimitiveType.LineList);

            #region After Named
            if (isNamed)
            {
                Display();

                #region Show Old Lines
                if (mapTerrain.Count != 0)
                {
                    foreach (Vector2 v2 in mapTerrain)
                    {
                        pb.AddVertex(v2, Color.White);
                    }
                }

                if (mapPads.Count != 0)
                {
                    foreach (Vector2 v2 in mapPads)
                    {
                        pb.AddVertex(v2, Color.Green);
                    }
                }
                #endregion

                #region Display Line
                if (makingTerrain)
                {
                    pb.AddVertex(new Vector2(lineStartLocation.X, lineStartLocation.Y), Color.White);
                    pb.AddVertex(new Vector2(newMouseState.X, newMouseState.Y), Color.White);
                }

                if (makingPads)
                {
                    pb.AddVertex(new Vector2(lineStartLocation.X, lineStartLocation.Y), Color.Green);
                    pb.AddVertex(new Vector2(newMouseState.X, lineStartLocation.Y), Color.Green);
                }
                #endregion
            }
            #endregion

            #region Before Named
            else
            {
                LinkedList <Vector2> screenTitle = MyFont.GetWord(GlobalValues.TitleFontScaleSize, "Map Creator");
                Vector2 screenTitlePos           = new Vector2(GlobalValues.GetWordCenterPos("Map Creator", true).X, 100);

                LinkedList <Vector2> mapTitle = MyFont.GetWord(GlobalValues.FontScaleSize, "Map Title");
                Vector2 mapTitlePos           = new Vector2(GlobalValues.GetWordCenterPos("Map Title", false).X, GlobalValues.GetWordCenterPos(levelName, false).Y - 75);

                LinkedList <Vector2> userWord = MyFont.GetWord(GlobalValues.FontScaleSize, levelName);
                Vector2 userWordPos           = GlobalValues.GetWordCenterPos(levelName, false);

                LinkedList <Vector2> continueWord = MyFont.GetWord(GlobalValues.FontScaleSize, "Press Enter to Continue");
                Vector2 continueWordPos           = new Vector2(GlobalValues.GetWordCenterPos("Press Enter to Continue", false).X, GlobalValues.GetWordCenterPos(levelName, false).Y + 75);

                #region Foreach
                foreach (Vector2 v2 in screenTitle)
                {
                    pb.AddVertex(v2 + screenTitlePos, Color.White);
                }

                foreach (Vector2 v2 in mapTitle)
                {
                    pb.AddVertex(v2 + mapTitlePos, Color.White);
                }

                foreach (Vector2 v2 in userWord)
                {
                    pb.AddVertex(v2 + userWordPos, Color.White);
                }

                foreach (Vector2 v2 in continueWord)
                {
                    pb.AddVertex(v2 + continueWordPos, Color.White);
                }
                #endregion
            }
            #endregion

            pb.End();
        }