Exemple #1
0
        public BoxingPlayer(Boxing_Manager bm, int playerIndex, Vector2 startPosition, Dictionary <string, Animation> animations, Input_Handler input, Color color,
                            Texture2D blank, Rectangle healthBar, Rectangle platform, Item[] items, Dictionary <string, SoundEffect> soundEffects)
        {
            this.BoxingManager = bm;

            this.items = items; // set the items. The items know the states to be called.

            // To test the accuracy of the collision rect
            this.blank = blank;

            this.playerIndex = playerIndex;

            this.animations = animations;

            this.input = input;

            this.color = color;

            this.soundEffects = soundEffects;

            this.startPosition = startPosition;
            this.platform      = platform;
            this.startPlatform = platform;
            levellevel         = platform.Y;

            this.rHealthBar   = healthBar;
            healthBarMaxWidth = healthBar.Width;

            // Listen for input
            input.OnKeyDown    += HandleKeyDown;
            input.OnKeyRelease += HandleKeyRelease;

            //
            //items[0] = true;
            //items[1] = true;
            //items[2] = true;
            //items[3] = true;

            /*combinations[0, 0] = KeyPressed.Defend;
             * combinations[0, 1] = KeyPressed.Up;
             * combinations[0, 2] = KeyPressed.Attack;
             *
             * combinations[1, 0] = KeyPressed.Defend;
             * combinations[1, 1] = KeyPressed.Up;
             * combinations[1, 2] = KeyPressed.Kick;
             *
             * combinations[2, 0] = KeyPressed.Defend;
             * combinations[2, 1] = KeyPressed.Down;
             * combinations[2, 2] = KeyPressed.Attack;
             *
             * combinations[3, 0] = KeyPressed.Defend;
             * combinations[3, 1] = KeyPressed.Down;
             * combinations[3, 2] = KeyPressed.Kick;*/

            // Set players for first round.
            Reset(startPosition);
        }
        List <Item>[] items; // an array of item lists containing all items, for use  in the loadout.

        #endregion



        public Brawl_Game_State(Game game, Input_Handler[] inputs, Rectangle bounds)
            : base(game, inputs, bounds)
        {
            // Load some assets
            font = game.Content.Load <SpriteFont>("Menu/menufont");
            SoundEffect menuSound = game.Content.Load <SoundEffect>("Sounds/MenuC");

            soundSelect = game.Content.Load <SoundEffect>("Sounds/MenuE");

            // Set initial state
            state           = brawlgamestate.settings; // Start by settings the number of rounds
            settingsManager = new Settings_Popup(this, game.Content, inputs, bounds);

            // Use the boxing managers background for all the others:
            boxingManager = new Boxing_Manager(game.Content, bounds, inputs, game.GraphicsDevice, game.camera);

            // Initialize each players library of items
            items = new List <Item> [4];
            for (int i = 0; i < 4; i++)
            {
                items[i] = new List <Item>();
                // Each player gets access to the full library
                items[i].Add(new Cane(game.Content.Load <Texture2D>("LoadOut/cane_icon")));
                items[i].Add(new Revolver(game.Content.Load <Texture2D>("LoadOut/revolver_icon")));
                items[i].Add(new Bowler_Hat(game.Content.Load <Texture2D>("LoadOut/bowlerhat_icon")));
                items[i].Add(new Cape(game.Content.Load <Texture2D>("LoadOut/cape_icon")));
            }



            // old stuff:

            // consruct the settings popup.
            //settings// = new Settings_Popup(game.Content, inputs, bounds);
            //settings//.menu.OnEntrySelect += HandleMenuSelect;

            // Construct the player_select_popup
            //playerSelect = new Player_Select_Popup(game.Content, inputs, bounds, game.GraphicsDevice);

            // Construct the Loadout manager.

            // construct the boxing manager for the background
            //boxingManager = new Boxing_Manager(game.Content, bounds, inputs, game.GraphicsDevice, game.camera);
        }
Exemple #3
0
        public Level(Boxing_Manager bm, Rectangle clientBounds, Texture2D tPlatform, Texture2D background)
        {
            BoxingManager     = bm;
            this.clientBounds = clientBounds;
            this.tPlatform    = tPlatform;
            this.Background   = background;

            LevelSize = new Rectangle(0, 0, clientBounds.Width, clientBounds.Height);//300 * 1, 255 * 1);

            platforms[0] = new Rectangle(18 * clientBounds.Width / 25, 8 * clientBounds.Height / 30, 7 * clientBounds.Width / 25, 10);

            platforms[1] = new Rectangle(0, 16 * clientBounds.Height / 36, 10 * clientBounds.Width / 12, 10);

            platforms[2] = new Rectangle(3 * clientBounds.Width / 27, 10 * clientBounds.Height / 16, 3 * clientBounds.Width / 18, 10);

            platforms[3] = new Rectangle(clientBounds.Width / 80, 9 * clientBounds.Height / 12, 3 * clientBounds.Width / 15, 10);

            // ground
            platforms[4] = new Rectangle(0, 6 * clientBounds.Height / 7, clientBounds.Width, 10);
        }
Exemple #4
0
        public Level(Boxing_Manager bm, Rectangle clientBounds, Texture2D tPlatform, Texture2D background)
        {
            BoxingManager = bm;
            this.clientBounds = clientBounds;
            this.tPlatform = tPlatform;
            this.Background = background;

            LevelSize = new Rectangle(0, 0, clientBounds.Width, clientBounds.Height);//300 * 1, 255 * 1);

            platforms[0] = new Rectangle(18 * clientBounds.Width / 25, 8 * clientBounds.Height / 30, 7 * clientBounds.Width / 25, 10);

            platforms[1] = new Rectangle(0, 16 * clientBounds.Height / 36, 10 * clientBounds.Width/ 12, 10);

            platforms[2] = new Rectangle(3 * clientBounds.Width / 27, 10 * clientBounds.Height / 16, 3* clientBounds.Width / 18, 10);

            platforms[3] = new Rectangle(clientBounds.Width / 80, 9 * clientBounds.Height / 12, 3 * clientBounds.Width / 15, 10);

            // ground
            platforms[4] = new Rectangle(0, 6 * clientBounds.Height / 7, clientBounds.Width, 10);
        }
Exemple #5
0
 public void Initialize()
 {
     Menu    = new Menu_Manager(this, ClientBounds, inputs);
     Auction = new Auction_Manager(this, ClientBounds, inputs);
     Boxing  = new Boxing_Manager(ClientBounds, inputs);
 }