Allows the user to select from a list of options. Author: Dennis Honeyman
Exemple #1
0
 public override void Resume()
 {
     if (player.Items.Count > 0)
         menu = new TextMenu(game.Content.Load<SpriteFont>("inventory-list-font"), getStringOfPlayerItems());
     if (oneTimeUse)
         StateManager.PopState();
 }
Exemple #2
0
        // constructor
        public Battle(Game game, Texture2D bgTex, Song battleSong, Player p, Enemy e, bool run)
            : base(game)
        {
            StateManager.PushState(new LevelState(game, p));

            play = p;
            en = e;
            font = game.Content.Load<SpriteFont>("battle-font");
            tMenu = new TextMenu(font, choices);
            combatColor = new Texture2D(game.GraphicsDevice, 1, 1);
            combatColor.SetData<Color>(new Color[] { new Color(Color.Black, 150) });
            transparent = true;
            rgen = new Random();

            try
            {
                if (battleSong != null)
                {
                    MediaPlayer.Play(battleSong);
                    MediaPlayer.Volume = .5f;
                    MediaPlayer.IsRepeating = true;
                }
            }
            catch (Exception)
            {
            }

            canRun = run;

            backgroundTexture = bgTex;
            hasRun = false;
            currentItemCount = play.Items.Count;
            calculateSpeed();
        }
Exemple #3
0
 public Store(Game game, Player pl, Item[] items)
     : base(game)
 {
     player = pl;
     storeInventory = items;
     storeTexture = new Texture2D(game.GraphicsDevice, 1, 1);
     storeTexture.SetData<Color>(new Color[] { new Color(Color.Gray, 255) });
     background = game.Content.Load<Texture2D>("store-bg");
     spriteFont = game.Content.Load<SpriteFont>("inventory-list-font");
     textInventory = new TextMenu(spriteFont, this.getItemNames(storeInventory));
 }
Exemple #4
0
 public MainMenu(Game game)
     : base(game)
 {
     font = game.Content.Load<SpriteFont>("main-menu-font");
     background = game.Content.Load<Texture2D>("main-menu-background");
     menu = new TextMenu(font, options);
     try
     {
         song = game.Content.Load<Song>("main-menu-song");
     }
     catch (Exception)
     {
     }
 }
Exemple #5
0
 //Health and mana will go up each level everytime
 public LevelState(Game game, Player player)
     : base(game)
 {
     this.play = player;
     font = game.Content.Load<SpriteFont>("level-up-menu-font");
     fontLevelUp = game.Content.Load<SpriteFont>("level-up-font");
     fontLevel = game.Content.Load<SpriteFont>("level-font");
     tMenu = new TextMenu(font, choices);
     transparent = true;
     increaseStats = true;
     combatColor = new Texture2D(game.GraphicsDevice, 1, 1);
     combatColor.SetData<Color>(new Color[] { new Color(Color.Black, 200) });
     pointsLeft = 0;
 }
Exemple #6
0
 public ItemState(Game game, Player player, bool oneTimeUse)
     : base(game)
 {
     this.player = player;
     texture = new Texture2D(game.GraphicsDevice, 1, 1);
     texture.SetData<Color>(new Color[] { new Color(Color.Black, 150) });
     font = game.Content.Load<SpriteFont>("inventory-header-font");
     //The menu is only needed if the player has items.
     if (player.Items.Count > 0)
         menu = new TextMenu(game.Content.Load<SpriteFont>("inventory-list-font"), getStringOfPlayerItems());
     canPressEscape = false;
     transparent = true;
     this.oneTimeUse = oneTimeUse;
 }
Exemple #7
0
 public override void Resume()
 {
     textInventory = new TextMenu(spriteFont, this.getItemNames(storeInventory));
 }