Exemplo n.º 1
0
        public override void LoadContent()
        {
            //Initialize viewport
            viewport = ScreenManager.Game.GraphicsDevice.Viewport;

            tutorialTexture = Load<Texture2D>("Textures/TutorialScreen");
            buttonBackTexture = Load<Texture2D>("Textures/Buttons/ButtonBack");

            //Initialize back button
            buttonBack = new Button();
            buttonBack.Initialize(buttonBackTexture, new Vector2(50, viewport.Height - 50), 1.0f);
            buttonBack.Selected += new EventHandler(buttonBack_Selected);

            //Add Menu Buttons
            MenuButtons.Add(buttonBack);
        }
Exemplo n.º 2
0
        public override void LoadContent()
        {
            //Initialize viewport
            viewport = ScreenManager.Game.GraphicsDevice.Viewport;

            //Initialize game over font
            gameOverFont = Load<SpriteFont>("Fonts/GameOverFont");

            //Initialize textures
            gameOverTexture = Load<Texture2D>("Textures/GameOverText");
            youClimbedTexture = Load<Texture2D>("Textures/YouClimbedText");
            highestClimbTexture = Load<Texture2D>("Textures/HighestClimbText");
            gemsCollectedTexture = Load<Texture2D>("Textures/GemsCollectedText");
            powerUpsUsedTexture = Load<Texture2D>("Textures/PowerUpsUsedText");
            shieldsUsedTexture = Load<Texture2D>("Textures/ShieldsUsedText");

            //Initialize button textures
            buttonReplayTexture = Load<Texture2D>("Textures/Buttons/ButtonReplay");
            buttonBackTexture = Load<Texture2D>("Textures/Buttons/ButtonBack");

            //Starting x-coordinate of textures
            float xPosition = (viewport.Width / 2) + 50;

            //Initialize position of textures
            youClimbedTexturePosition = new Vector2(xPosition, 320);
            highestClimbTexturePosition = new Vector2(xPosition, 400);
            gemsCollectedTexturePosition = new Vector2(xPosition, 440);
            powerUpsUsedTexturePosition = new Vector2(xPosition, 480);
            shieldsUsedTexturePosition = new Vector2(xPosition, 520);

            //Initialize back button
            buttonBack = new Button();
            buttonBack.Initialize(buttonBackTexture, new Vector2((viewport.Width / 2) - 60, 620), 1.0f);
            buttonBack.Selected += new EventHandler(buttonBack_Selected);

            //Initialize replay button
            buttonReplay = new Button();
            buttonReplay.Initialize(buttonReplayTexture, new Vector2((viewport.Width / 2) + 60, 620), 1.0f);
            buttonReplay.Selected += new EventHandler(buttonReplay_Selected);

            //Add buttons to the menu button list
            MenuButtons.Add(buttonReplay);
            MenuButtons.Add(buttonBack);

            base.LoadContent();
        }
Exemplo n.º 3
0
        public override void LoadContent()
        {
            viewport = ScreenManager.Game.GraphicsDevice.Viewport;

            //Main menu texture to be rendered on the screen
            backgroundTexture = Load<Texture2D>("Textures/MenuTitle");
            stringTexture = Load<Texture2D>("Textures/TapToAmbush");
            stringPosition = new Vector2(viewport.Width / 2, 480);
            backgroundPosition = Vector2.Zero;

            //Initialize button textures
            buttonHighscoresTexture = Load<Texture2D>("Textures/Buttons/ButtonHighscores");
            buttonSoundOnTexture = Load<Texture2D>("Textures/Buttons/ButtonSoundOn");
            buttonSoundOffTexture = Load<Texture2D>("Textures/Buttons/ButtonSoundOff");
            buttonHelpTexture = Load<Texture2D>("Textures/Buttons/ButtonHelp");
            buttonRateAppTexture = Load<Texture2D>("Textures/Buttons/ButtonRateApp");

            float yButtonPosition = 650;

            //Initialize high scores button
            buttonHighscores = new Button();
            buttonHighscores.Initialize(buttonHighscoresTexture, new Vector2((viewport.Width / 2) - 100, yButtonPosition), 0.9f);
            buttonHighscores.Selected += new EventHandler(buttonHighscores_Selected);

            //Initialize sound button
            buttonSound = new Button();
            buttonSound.Initialize(buttonSoundOnTexture, new Vector2((viewport.Width / 2), yButtonPosition), 0.9f);
            buttonSound.Selected +=new EventHandler(buttonSound_Selected);

            settings.TryGetValue<bool>("IsSoundOn", out IsSoundOn);

            if (IsSoundOn)
            {
                buttonSound.ButtonTexture = buttonSoundOnTexture;
            }
            else
            {
                buttonSound.ButtonTexture = buttonSoundOffTexture;
            }

            //Initialize help button
            buttonHelp = new Button();
            buttonHelp.Initialize(buttonHelpTexture, new Vector2((viewport.Width / 2) + 100, yButtonPosition), 0.9f);
            buttonHelp.Selected += new EventHandler(buttonHelp_Selected);

            buttonRateApp = new Button();
            buttonRateApp.Initialize(buttonRateAppTexture, new Vector2(viewport.Width / 2, yButtonPosition + 90), 1.0f);
            buttonRateApp.Selected += new EventHandler(buttonRateApp_Selected);

            //Add menu buttons to list
            MenuButtons.Add(buttonHighscores);
            MenuButtons.Add(buttonSound);
            MenuButtons.Add(buttonHelp);
            MenuButtons.Add(buttonRateApp);

            base.LoadContent();
        }
Exemplo n.º 4
0
        public override void LoadContent()
        {
            viewport = ScreenManager.Game.GraphicsDevice.Viewport;

            //Animation store initialization
            animationStore = new AnimationStore();
            animationStore.Initialize(ScreenManager.Game.Content);

            //Ninja player initialization
            player = new Player(ScreenManager.Game, animationStore, this);
            player.Initialize();

            //Set the initial camera position to height of screen
            cameraPosition = 0;

            LoadAssets();

            pauseButton = new Button();
            pauseButton.Initialize(pauseButtonTexture, new Vector2(30, 30), 1.3f);
            pauseButton.Selected += new EventHandler(pauseButton_Selected);
            MenuButtons.Add(pauseButton);

            base.LoadContent();
        }
Exemplo n.º 5
0
        /// <summary>
        /// Load screen resources
        /// </summary>
        public override void LoadContent()
        {
            //Initialize viewport
            viewport = ScreenManager.Game.GraphicsDevice.Viewport;

            highscoreTexture = Load<Texture2D>("Textures/HighscoreText");
            buttonBackTexture = Load<Texture2D>("Textures/Buttons/ButtonBack");
            highScoreFont = Load<SpriteFont>("Fonts/MenuFont");

            LoadHighscores();

            //Initialize back button
            buttonBack = new Button();
            buttonBack.Initialize(buttonBackTexture, new Vector2((viewport.Width / 2), 700), 1.0f);
            buttonBack.Selected += new EventHandler(buttonBack_Selected);

            //Add Menu Buttons
            MenuButtons.Add(buttonBack);

            base.LoadContent();
        }