public Player_Select_Popup(Game_State manager, ContentManager content, Input_Handler[] inputs, Rectangle bounds, GraphicsDevice graphicsDevice)
            : base(content, bounds)
        {
            this.manager      = manager;
            this.inputs       = inputs;
            this.ClientBounds = bounds;

            soundMenuA = content.Load <SoundEffect>("Sounds/MenuA");
            soundMenuC = content.Load <SoundEffect>("Sounds/MenuC");
            soundMenuD = content.Load <SoundEffect>("Sounds/MenuD");

            font = content.Load <SpriteFont>("Menu/menufont");
            for (int i = 0; i < 4; i++)
            {
                // Hook up input listener
                inputs[i].OnKeyRelease += HandleInput;

                // Set positions
                playerMenuBounds[i] = new Rectangle(((i) * ClientBounds.Width / 4), 0, ClientBounds.Width / 4, ClientBounds.Height);

                // Initialize the meus
                menus[i] = new Player_Select_Menu(content, this, font, playerMenuBounds[i]);
            }

            populateColors(content, graphicsDevice);
        }
        public Player_Select_Popup(Game_State manager, ContentManager content, Input_Handler[] inputs, Rectangle bounds, GraphicsDevice graphicsDevice)
            : base(content, bounds)
        {
            this.manager = manager;
            this.inputs = inputs;
            this.ClientBounds = bounds;

            soundMenuA = content.Load<SoundEffect>("Sounds/MenuA");
            soundMenuC = content.Load<SoundEffect>("Sounds/MenuC");
            soundMenuD = content.Load<SoundEffect>("Sounds/MenuD");

            font = content.Load<SpriteFont>("Menu/menufont");
            for (int i = 0; i < 4; i++)
            {
                // Hook up input listener
                inputs[i].OnKeyRelease += HandleInput;

                // Set positions
                playerMenuBounds[i] = new Rectangle(((i) * ClientBounds.Width / 4), 0, ClientBounds.Width / 4, ClientBounds.Height);

                // Initialize the meus
                menus[i] = new Player_Select_Menu(content, this, font, playerMenuBounds[i]);

            }

            populateColors(content, graphicsDevice);
        }
Example #3
0
        /// <summary>
        /// Stop listening
        /// </summary>
        /// <param name="state"></param>
        protected override void ChangeState(Game_State state)
        {
            // Stop listening
            inputs[0].OnKeyRelease -= menu.ChangeIndex;
            menu.OnEntrySelect     -= MenuEntrySelect;

            base.ChangeState(state);
        }
Example #4
0
 public LoadOut_Manager(Game_State state, Rectangle ClientBounds, Input_Handler[] inputs,
                        List <Item>[] items)
 {
     this.state_man    = state;
     this.ClientBounds = ClientBounds;
     this.inputs       = inputs;
     this.items        = items;
     //this.equipment = state.equipment;
 }
Example #5
0
 public LoadOut_Manager(Game_State state, Rectangle ClientBounds, Input_Handler[] inputs,
     List<Item>[] items)
 {
     this.state_man = state;
     this.ClientBounds = ClientBounds;
     this.inputs = inputs;
     this.items = items;
     //this.equipment = state.equipment;
 }
Example #6
0
        public Settings_Popup(Game_State manager, ContentManager content, Input_Handler[] inputs, Rectangle bounds)
            : base(content, bounds)
        {
            // Make a white boundary smaller than the bounds.
            menuBounds = new Rectangle(bounds.Width / 20, bounds.Height / 20,
                bounds.Width - (bounds.Width / 20) * 2, bounds.Height - (bounds.Height / 20) * 2);
            //Debug.WriteLine(menuBounds.X + " " + menuBounds.Y + " " + menuBounds.Width + " " + menuBounds.Height);

            SoundEffect menuSound = content.Load<SoundEffect>("Sounds/MenuC");

            menu = new Settings_Menu(content.Load<SpriteFont>("Menu/menufont"), menuBounds, menuSound);

            this.manager = manager;
            manager.inputs[0].OnKeyRelease += HandleInput;
        }
Example #7
0
        public Settings_Popup(Game_State manager, ContentManager content, Input_Handler[] inputs, Rectangle bounds)
            : base(content, bounds)
        {
            // Make a white boundary smaller than the bounds.
            menuBounds = new Rectangle(bounds.Width / 20, bounds.Height / 20,
                                       bounds.Width - (bounds.Width / 20) * 2, bounds.Height - (bounds.Height / 20) * 2);
            //Debug.WriteLine(menuBounds.X + " " + menuBounds.Y + " " + menuBounds.Width + " " + menuBounds.Height);

            SoundEffect menuSound = content.Load <SoundEffect>("Sounds/MenuC");

            menu = new Settings_Menu(content.Load <SpriteFont>("Menu/menufont"), menuBounds, menuSound);

            this.manager = manager;
            manager.inputs[0].OnKeyRelease += HandleInput;
        }
Example #8
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            //sm = new State_Manager(Content, Window.ClientBounds);
            //sm.Initialize();


            // Initialize the inputs.
            inputs = new Input_Handler[] {
                new Input_Handler(0),
                new Input_Handler(1),
                new Input_Handler(2),
                new Input_Handler(3)
            };

            // Set the current state to the main menu.
            currentState = new Main_Game_State(this, inputs, new Rectangle(0, 0, Window.ClientBounds.Width, Window.ClientBounds.Height));

            //GraphicsDevice.SamplerStates[0] = SamplerState.PointWrap;

            base.Initialize();
        }
Example #9
0
 protected virtual void ChangeState(Game_State state)
 {
     game.currentState = state;
 }
Example #10
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            //sm = new State_Manager(Content, Window.ClientBounds);
            //sm.Initialize();

            // Initialize the inputs.
            inputs = new Input_Handler[] {
                new Input_Handler(0),
                new Input_Handler(1),
                new Input_Handler(2),
                new Input_Handler(3) };

            // Set the current state to the main menu.
            currentState = new Main_Game_State(this, inputs, new Rectangle(0,0,Window.ClientBounds.Width, Window.ClientBounds.Height));

            //GraphicsDevice.SamplerStates[0] = SamplerState.PointWrap;

            base.Initialize();
        }
Example #11
0
 protected virtual void ChangeState(Game_State state)
 {
     game.currentState = state;
 }