Example #1
0
 public InstructionsScreen()
     : base("")
 {
     Button backButton = new Button("Back");
     backButton.Tapped += menuButton_Tapped;
     MenuButtons.Add(backButton);
 }
        public PhonePauseScreen()
            : base("Paused")
        {
            // Create the "Resume" and "Exit" buttons for the screen

            Button resumeButton = new Button("Resume");
            resumeButton.Tapped += resumeButton_Tapped;
            MenuButtons.Add(resumeButton);

            Button exitButton = new Button("Exit");
            exitButton.Tapped += exitButton_Tapped;
            MenuButtons.Add(exitButton);
        }
Example #3
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);
        }
Example #4
0
        public PlayScreen()
        {
            //Define the gestures to be used in this screen
            EnabledGestures = GestureType.FreeDrag | GestureType.DragComplete | GestureType.Tap;

            //The game has just started so the game is not over
            gameOver = false;

            IsPopup = true;

            PauseButton = new Button();
            PauseButton.Selected += PauseButtonSelected;

            //The game has just started so do not pause the game
            isPaused = false;
        }
Example #5
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();
        }
Example #6
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();
        }
Example #7
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();
        }
Example #8
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();
        }