Exemplo n.º 1
0
        /// <summary>
        /// Creates a new HUD object.
        /// </summary>
        /// <param name="content">The content manager to use for assets.</param>
        /// <param name="player">The player to attack this HUD to.</param>
        public HUD(ContentManager content, Player player)
        {
            Content = content;

            healthBar = new GameGraphic("HealthBar", Content);
            keyChain = new GameGraphic("KeyChain", Content);

            grayTexture = new Texture2D(GameResources.Device, 1, 1);
            grayTexture.SetData(new[] { Color.Gray });

            redTexture = new Texture2D(GameResources.Device, 1, 1);
            redTexture.SetData(new[] { Color.Red });

            darkGrayTexture = new Texture2D(GameResources.Device, 1, 1);
            darkGrayTexture.SetData(new[] { new Color(102, 102, 102) });

            healthBar.Coordinates = new Vector2(HP_BAR_X, HP_BAR_Y);
            keyChain.Coordinates = new Vector2(KEYCHAIN_X, KEYCHAIN_Y);

            roomFont = Content.Load<SpriteFont>("Fonts/Philo42");
            saveFont = Content.Load<SpriteFont>("Fonts/Philo18");
            infoFont = Content.Load<SpriteFont>("Fonts/Philo24");

            keyArray = new bool[1];
            for (int i = 0; i < keyArray.Length; i++)
                keyArray[i] = false;
        }
Exemplo n.º 2
0
        public InfoBox(string m, DelVoid cb, bool removable)
        {
            Content = new ContentManager(GameResources.GameServices, "Content");
            background = new GameGraphic("InfoBox", Content);
            font = Content.Load<SpriteFont>("Fonts/Philo14");
            callback = cb;
            message = m;
            oldKeyState = Keyboard.GetState();
            newKeyState = Keyboard.GetState();
            oldGamePadState = GamePad.GetState(PlayerIndex.One);
            newGamePadState = GamePad.GetState(PlayerIndex.One);

            isRemovable = removable;
            if (isRemovable)
                instruction = "A/Enter: Okay";
            else
                instruction = "";
        }
Exemplo n.º 3
0
        /// <summary>
        /// Constructor call
        /// </summary>
        /// <param name="settings">The game settings to write to</param>
        public OptionsMenu(GameManager.GameSettings settings)
        {
            gameSettings = settings;
            InitializeButtons();

            font = Content.Load<SpriteFont>("Fonts/MenuFont");
            background = new GameGraphic("OptionsMenuBackground", Content);

            nodeList = new List<MenuNode>();
            nodeList.Add(BackButton);
            nodeList.Add(MusicVolume);
            nodeList.Add(SoundEffectsVolume);

            selectedNode = MusicVolume;
            MusicVolume.IsSelected = true;

            hasFocus = true;

            musicVolume = (int)(gameSettings.MusicVolume * 100);
            soundEffectsVolume = (int)(gameSettings.SoundEffectsVolume * 100);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Constructor call.
        /// </summary>
        /// <param name="c">The callback method to use</param>
        /// <param name="settings">The game settings to write to</param>
        public PauseMenu(DelMenu c, GameManager.GameSettings settings)
        {
            gameSettings = settings;
            callback = c;
            InitializeButtons();
            font = Content.Load<SpriteFont>("Fonts/MenuFont");
            background = new GameGraphic("OptionsMenuBackground", Content);

            selectedNode = ResumeButton;
            ResumeButton.IsSelected = true;

            nodeList = new List<MenuNode>();
            nodeList.Add(ResumeButton);
            nodeList.Add(LoadButton);
            nodeList.Add(OptionsButton);
            nodeList.Add(QuitButton);

            hasFocus = true;
            isPaused = true;
            isOptionsDisplayed = false;
        }
Exemplo n.º 5
0
        public Credits()
        {
            Content = new ContentManager(GameResources.GameServices, "Content");
            backgroundRectangle = new Rectangle(0, 0, 1280, 720);

            blackTexture = new Texture2D(GameResources.Device, 1, 1);
            blackTexture.SetData(new[] { Color.Black });

            font = Content.Load<SpriteFont>("Fonts/Philo14");
            biggerFont = Content.Load<SpriteFont>("Fonts/Philo24");

            mummy = new GameGraphic("Mummy", Content);

            hasFocus = true;

            basePosition = 720;

            newKeyState = Keyboard.GetState();
            oldKeyState = Keyboard.GetState();
            oldGPState = GamePad.GetState(PlayerIndex.One);
            newGPState = GamePad.GetState(PlayerIndex.One);

            InitializeCredits();
        }
Exemplo n.º 6
0
 /// <summary>
 /// Displays the Death Screen
 /// </summary>
 private void ShowDeathScreen()
 {
     isFrozen = true;
     deathScreen = new GameGraphic("DeathScreen", gameContent);
     isDeathScreenUp = true;
 }