Exemple #1
0
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // Load the content for the menu state
            menuBgTex = Content.Load <Texture2D>("MainScreenPieces");
            //gameBtnTex = Content.Load<Texture2D>("StartBut");
            //tutorialBtnTex = Content.Load<Texture2D>("RulesBut");
            //quitBtnTex = Content.Load<Texture2D>("EndBut");

            // This is used as the normal cursor, will also be used in other states
            player1JojamianCursor = Content.Load <Texture2D>("blueCursor");

            //mainMenuBackground = Content.Load<Texture2D>(
            onePlayerJojamian = Content.Load <Texture2D>("Button_OnePlayer");
            twoPlayerJojamian = Content.Load <Texture2D>("Button_TwoPlayer");
            rulesJojamian     = Content.Load <Texture2D>("Button_Rules");
            endGame           = Content.Load <Texture2D>("Button_End");
            onePlayerOthello  = Content.Load <Texture2D>("Button_Othello");


            menu.LoadContent(spriteBatch, menuBgTex, player1JojamianCursor,
                             onePlayerJojamian, twoPlayerJojamian, rulesJojamian,
                             endGame, onePlayerOthello);

            // Load the content for the instructions state
            instruction1BgTex = Content.Load <Texture2D>("NewInstructions");
            instruction2BgTex = Content.Load <Texture2D>("NewInstructions1");
            instruction3BgTex = Content.Load <Texture2D>("NewInstructions2");
            mainBtnTex        = Content.Load <Texture2D>("StartGameBut");
            backBtnTex        = Content.Load <Texture2D>("BackButton");
            nextBtnTex        = Content.Load <Texture2D>("NextButton");
            moveAnim          = Content.Load <Texture2D>("NewMoveAnim");
            attAnim           = Content.Load <Texture2D>("NewAttackAnim");
            tipsAnim          = Content.Load <Texture2D>("TipsAnim");
            tipsAnimLeft      = Content.Load <Texture2D>("TipsAnimLeft");
            tipsAnimRight     = Content.Load <Texture2D>("TipsAnimRight");

            instructions.LoadContent(spriteBatch, instruction1BgTex,
                                     instruction2BgTex, instruction3BgTex,
                                     moveAnim, attAnim,
                                     tipsAnim, tipsAnimLeft,
                                     tipsAnimRight, player1JojamianCursor,
                                     mainBtnTex, backBtnTex,
                                     nextBtnTex);

            // Load the content for the game state
            jojamianBoardTex         = Content.Load <Texture2D>("BoardTest");
            player1JojamianTex       = Content.Load <Texture2D>("Blue");
            player2JojamianTex       = Content.Load <Texture2D>("Green");
            player1SelectTex         = Content.Load <Texture2D>("BlueSelection");
            player2SelectTex         = Content.Load <Texture2D>("GreenSelection");
            player1ToPlayer2Jojamian = Content.Load <Texture2D>("BlueToGreen");
            player2ToPlayer1Jojamian = Content.Load <Texture2D>("GreenToBlue");
            transparentToPlayer1     = Content.Load <Texture2D>("TransToPlr1");
            transparentToPlayer2     = Content.Load <Texture2D>("TransToPlr2");
            player1JojamianBanner    = Content.Load <Texture2D>("BlueBanner");
            player2JojamianBanner    = Content.Load <Texture2D>("GreenBanner");

            //Load the content for the othello state
            othelloBoardTex         = Content.Load <Texture2D>("Board8x8Green");
            player1OthelloTex       = Content.Load <Texture2D>("Black");
            player2OthelloTex       = Content.Load <Texture2D>("White");
            player1ToPlayer2Othello = Content.Load <Texture2D>("blackToWhite");
            player2ToPlayer1Othello = Content.Load <Texture2D>("whiteToBlack");
            player1OthelloBanner    = Content.Load <Texture2D>("BlackBanner");
            player2OthelloBanner    = Content.Load <Texture2D>("WhiteBanner");
            player1OthelloCursor    = Content.Load <Texture2D>("BlackCursor");
            player2OthelloCursor    = Content.Load <Texture2D>("WhiteCursor");

            // Load the content for the credit state
            creditBgTex = Content.Load <Texture2D>("Credits");


            player2JojamianCursor = Content.Load <Texture2D>("GreenCursor");

            credits.LoadContent(spriteBatch, creditBgTex, player2JojamianCursor);

            //Load the sounds
            mtInstructionScreen1 = Content.Load <SoundEffect>
                                       ("MouseToneInstructionScreen_8Bit(hi)");
            mtInstructionScreen2 = Content.Load <SoundEffect>
                                       ("MouseToneInstructionScreen_8Bit(low)");
            playerOneToPlayerTwo = Content.Load <SoundEffect>
                                       ("Transform_8Bit");
            selectPiece = Content.Load <SoundEffect>
                              ("PieceSelectTone_8Bit");
            unavailableMove = Content.Load <SoundEffect>
                                  ("UnavailableMove_8Bit");
            availableMove = Content.Load <SoundEffect>
                                ("AvailableMove_8Bit");


            board.LoadContent(spriteBatch, jojamianBoardTex, player1JojamianTex,
                              player2JojamianTex, player2SelectTex, player1SelectTex,
                              player1ToPlayer2Jojamian, player2ToPlayer1Jojamian, transparentToPlayer1,
                              transparentToPlayer2, player1JojamianCursor, player2JojamianCursor,
                              player1JojamianBanner, player2JojamianBanner);

            board.LoadAudio(selectPiece, unavailableMove, availableMove,
                            playerOneToPlayerTwo);

            menu.LoadAudio(mtInstructionScreen1);

            instructions.LoadAudio(mtInstructionScreen2);

            aiBoard.LoadContent(spriteBatch, jojamianBoardTex, player1JojamianTex,
                                player2JojamianTex, player2SelectTex, player1SelectTex,
                                player1ToPlayer2Jojamian, player2ToPlayer1Jojamian, transparentToPlayer1,
                                transparentToPlayer2, player1JojamianCursor, player2JojamianCursor,
                                player1JojamianBanner, player2JojamianBanner);

            aiBoard.LoadAudio(selectPiece, unavailableMove, availableMove,
                              playerOneToPlayerTwo);

            othello.LoadContent(spriteBatch, othelloBoardTex, player1OthelloTex,
                                player2OthelloTex, player1ToPlayer2Othello, player2ToPlayer1Othello,
                                player1OthelloBanner, player2OthelloBanner, player1OthelloCursor, player2OthelloCursor,
                                transparentToPlayer1, transparentToPlayer2);

            othello.LoadAudio(selectPiece, unavailableMove, availableMove,
                              playerOneToPlayerTwo);
        }