Exemplo n.º 1
0
        //Add all text.
        public ScoreManager(HighScoreClass _highScores, ContentManager content)
        {
            places     = new List <TextClass>();
            scores     = new List <TextClass>();
            names      = new List <TextClass>();
            highScores = _highScores;

            input = new TextClass("Input name: " + name + "|", "Font", Color.White, new Vector2(0, 0));

            places.Add(new TextClass("1st", "Font", Color.White, new Vector2(textSpaceX, textSpaceY * 1)));
            places.Add(new TextClass("2nd", "Font", Color.White, new Vector2(textSpaceX, textSpaceY * 2)));
            places.Add(new TextClass("3rd", "Font", Color.White, new Vector2(textSpaceX, textSpaceY * 3)));

            for (int i = 0; i < 10; i++)
            {
                if (i > 2)
                {
                    places.Add(new TextClass((i + 1).ToString() + "th", "Font", Color.White, new Vector2(50, textSpaceY + textSpaceY * i)));
                }
                scores.Add(new TextClass("", "Font", Color.White, new Vector2(textSpaceX * 3, textSpaceY + textSpaceY * i)));
                names.Add(new TextClass("", "Font", Color.White, new Vector2(textSpaceX * 6, textSpaceY + textSpaceY * i)));
            }

            //Get the score from the files.
            GetScore();
        }
Exemplo n.º 2
0
        //Add all text.
        public ScoreManager(HighScoreClass _highScores, ContentManager content)
        {
            places = new List<TextClass>();
            scores = new List<TextClass>();
            names = new List<TextClass>();
            highScores = _highScores;

            input = new TextClass("Input name: " + name + "|", "Font", Color.White, new Vector2(0, 0));

            places.Add(new TextClass("1st", "Font", Color.White, new Vector2(textSpaceX, textSpaceY * 1)));
            places.Add(new TextClass("2nd", "Font", Color.White, new Vector2(textSpaceX, textSpaceY * 2)));
            places.Add(new TextClass("3rd", "Font", Color.White, new Vector2(textSpaceX, textSpaceY * 3)));

            for (int i = 0; i < 10; i++)
            {
                if (i > 2)
                {
                    places.Add(new TextClass((i + 1).ToString() + "th", "Font", Color.White, new Vector2(50, textSpaceY + textSpaceY * i)));
                }
                scores.Add(new TextClass("", "Font", Color.White, new Vector2(textSpaceX * 3, textSpaceY + textSpaceY * i)));
                names.Add(new TextClass("", "Font", Color.White, new Vector2(textSpaceX * 6, textSpaceY + textSpaceY * i)));
            }

            //Get the score from the files.
            GetScore();
        }
Exemplo n.º 3
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);

            //Sends data to my super-class for all to use.
            Position.content      = Content;
            Position.ScreenWidth  = graphics.GraphicsDevice.Viewport.Width;
            Position.ScreenHeight = graphics.GraphicsDevice.Viewport.Height;

            //Create and load my High Scores.
            highScore = new HighScoreClass(Content);
            highScore.LoadScores();
            highScore.SetScores();

            //Create my managers.
            gameManager  = new GameManager(graphics.GraphicsDevice.Viewport, new Vector2(50, 50), 10, 3, 100);
            menuManager  = new MenuManager();
            scoreManager = new ScoreManager(highScore, Content);
            // TODO: use this.Content to load your game content here
        }
Exemplo n.º 4
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);

            //Sends data to my super-class for all to use.
            Position.content = Content;
            Position.ScreenWidth = graphics.GraphicsDevice.Viewport.Width;
            Position.ScreenHeight = graphics.GraphicsDevice.Viewport.Height;

            //Create and load my High Scores.
            highScore = new HighScoreClass(Content);
            highScore.LoadScores();
            highScore.SetScores();

            //Create my managers.
            gameManager = new GameManager(graphics.GraphicsDevice.Viewport, new Vector2(50, 50), 10, 3, 100);
            menuManager = new MenuManager();
            scoreManager = new ScoreManager(highScore, Content);
            // TODO: use this.Content to load your game content here
        }