示例#1
0
 public Options(ContentManager content,BarFight parent)
 {
     this.parent = parent;
     Texture2D AA,resolution,rumble,sfx,music,fullscreen,accept,exit;
     AA = content.Load<Texture2D>("antialiasing");
     resolution = content.Load<Texture2D>("resolution");
     rumble = content.Load<Texture2D>("rumble");
     sfx = content.Load<Texture2D>("soundfx");
     music = content.Load<Texture2D>("music");
     fullscreen = content.Load<Texture2D>("fullscreen");
     accept = content.Load<Texture2D>("start");
     exit = content.Load<Texture2D>("exit");
     x = parent.ScreenWidth / 2 - (AA.Width / 2);
     y = parent.ScreenHeight / 2 - ((4 + AA.Height * 5) / 2);
     width = AA.Width;
     height = AA.Height;
     menu = new Menu(4, new Rectangle(x, y, width, height), AA, resolution, rumble, sfx, music,fullscreen,accept,exit);
     settings = new Settings();
     settings.AA = true;
     settings.height = screenResos[0][1];
     settings.width = screenResos[0][0];
     settings.music = true;
     settings.rumble = true;
     settings.sfx = true;
     font = content.Load<SpriteFont>("Font");
     message = "";
 }
 public PlayerSelector(ContentManager content,Game1 parent)
 {
     this.parent = parent;
     left = content.Load<Texture2D>("Left");
     right = content.Load<Texture2D>("Right");
     Texture2D go, exit;
     go = content.Load<Texture2D>("Start");
     exit = content.Load <Texture2D>("Exit");
     menu = new Menu(4, new Rectangle(parent.ScreenWidth / 2 - (go.Width / 2), parent.ScreenHeight / 2, go.Width, go.Height), go, exit);
     font = content.Load<SpriteFont>("Font");
     timer = InputDelay;
     numOfPlayers = MinNumOfPlayers;
 }
示例#3
0
        public Options(ContentManager content,Game1 parent)
        {
            this.parent = parent;
            Texture2D AA,resolution,rumble,sfx,music;
            AA = content.Load<Texture2D>("antialiasing");
            resolution = content.Load<Texture2D>("resolution");
            rumble = content.Load<Texture2D>("rumble");
            sfx = content.Load<Texture2D>("soundfx");
            music = content.Load<Texture2D>("music");

            x = parent.ScreenWidth / 2 - (AA.Width / 2);
            y = parent.ScreenHeight / 2 - ((4 + AA.Height * 5) / 2);
            width = AA.Width;
            height = AA.Height;
            menu = new Menu(4, new Rectangle(x, y, width, height), AA, resolution, rumble, sfx, music);
            settings = new Settings();
            settings.AA = true;
            settings.height = screenResos[0][1];
            settings.width = screenResos[0][0];
        }
 public void LoadLevelSelection(string fileAddress,ContentManager content)
 {
     levelData.Clear();
     BFFileReader reader = new BFFileReader(fileAddress);
     reader.Open();
     string line = null;
     while((line = reader.ReadLine())!= null)
     {
         LevelData levelInfo;
         string[] param = line.Split(' ');
         levelInfo.name = param[0];
         levelInfo.texture = content.Load<Texture2D>(param[1]);
         levelData.AddLast(levelInfo);
     }
     reader.Close();
     data = levelData.First;
     //load the left and right arrow textures
     leftArrowTex = content.Load<Texture2D>("Left");
     rightArrowTex = content.Load<Texture2D>("Right");
     Texture2D exit = content.Load<Texture2D>("Exit");
     Texture2D start = content.Load<Texture2D>("Resume");
     font = content.Load<SpriteFont>("Font");
     selection = new Menu(4, new Rectangle(parent.ScreenWidth/2 -(exit.Width/2),parent.ScreenHeight/2+15,exit.Width,exit.Height),start,exit);
     time = InputDelay;
 }
示例#5
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            shader = new Shader(Content);

            //load the font
            font = Content.Load<SpriteFont>("font");

            room = new Room(GraphicsDevice, this);
            Texture2D texture1, texture2,texture3,texture4,texture5;
            texture1 = Content.Load<Texture2D>("Start");
            texture2 = Content.Load<Texture2D>("Exit");
            texture3 = Content.Load<Texture2D>("credits");
            texture4 = Content.Load<Texture2D>("controls");
            texture5 = Content.Load<Texture2D>("options");

            state = GameState.MainMenu;
            MainMenu = new Menu(4, new Rectangle(screenWidth / 2 - (texture1.Width / 2), screenHeight / 2 - (texture1.Height / 2), texture1.Width, texture2.Height), texture1, texture2,texture3,texture4,texture5);
            selector = new LevelSelection(this);
            characterSelector = new CharacterSelection( this, GraphicsDevice);
            playerSelector = new PlayerSelector(Content, this);

            mainBack = Content.Load<Texture2D>("Barback");

            //load the background music
            backMusic = Content.Load<SoundEffect>("BARFIGHT").CreateInstance();
            backMusic.IsLooped = true;
            backMusic.Play();
            credits = new Credits(Content, this);
            controls = new Controls(Content, this);
            options = new Options(Content, this);
            //loadRoom("Files/Rooms/room1.txt");
        }
 public void loadCombatants(string address,ContentManager content)
 {
     BFFileReader reader = new BFFileReader(address);
     reader.Open();
     string line;
     while((line = reader.ReadLine()) != null)
     {
         string dataName = "";
         string[] param1 = line.Split(' ');
         List<Texture2D> textures = new List<Texture2D>();
         BFFileReader reader2 = new BFFileReader("Files/Combatants/" + param1[1] + ".txt");
         reader2.Open();
         string line2;
         while ((line2 = reader2.ReadLine()) != null)
         {
             string[] param = line2.Split(' ');
             if(param[0] == "Texture")
             {
                 textures.Add(content.Load<Texture2D>(param[1]));
             }
             else
             if(param[0] == "ModelID")
             {
                 dataName = param[1];
             }
         }
         CharacterInfo info = new CharacterInfo();
         AnimatedModel model = new AnimatedModel(dataName);
         string name = param1[0];
         string modelName = param1[1];
         info.model = model;
         info.model.LoadContent(content);
         info.name = name;
         info.modelName = modelName;
         info.model.textures = textures.ToArray();
         combatants.AddLast(info);
         reader2.Close();
         numOfPlayers = parent.NumOfPlayers;
     }
     font = content.Load<SpriteFont>("Font");
     //play all of the animations on the models
     foreach(CharacterInfo info in combatants)
     {
         info.model.PlayAnimation("WalkFight", true);
     }
     data = combatants.First;
     reader.Close();
     wallTexture = content.Load<Texture2D>("walls");
     Texture2D start, cancel;
     start = content.Load<Texture2D>("Start");
     cancel = content.Load<Texture2D>("Exit");
     menu = new Menu(4, new Rectangle(parent.ScreenWidth / 2 - (start.Width / 2), parent.ScreenHeight / 2, start.Width, start.Height), start, cancel);
 }