Ejemplo n.º 1
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);

            // create the deck object and shuffle
            Deck deck = new Deck(Content, 100, 100);

            deck.Shuffle();

            // create the player hands and fully deal the deck into the hands
            playerOneHand = new WarHand(WINDOW_WIDTH / 2, 100);
            playerTwoHand = new WarHand(WINDOW_WIDTH / 2, WINDOW_HEIGHT - 100);

            for (int i = 0; i < 2; i++)
            {
                playerOneHand.AddCard(deck.TakeTopCard());
                playerTwoHand.AddCard(deck.TakeTopCard());
            }

            // create the player battle piles
            playerOneBP = new WarBattlePile(WINDOW_WIDTH / 2, 200);
            playerTwoBP = new WarBattlePile(WINDOW_WIDTH / 2, WINDOW_HEIGHT - 200);

            // create the player winner messages
            playerOneWM = new WinnerMessage(Content, WINDOW_WIDTH / 2 + 150, 100);
            playerTwoWM = new WinnerMessage(Content, WINDOW_WIDTH / 2 + 150, WINDOW_HEIGHT - 100);


            // create the menu buttons
            flipButton      = new MenuButton(Content, "flipbutton", 150, 150, GameState.Flip);
            quitButton      = new MenuButton(Content, "quitbutton", 150, 450, GameState.Quit);
            collectWinnings = new MenuButton(Content, "collectwinningsbutton", 150, 300, GameState.CollectWinnings);
        }
Ejemplo n.º 2
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);

            // create the deck object and shuffle
            Deck deck = new Deck(Content, 0, 0);

            deck.Shuffle();

            // create the player hands and fully deal the deck into the hands
            // WINDOW_HEIGHT / 6 and WINDOW_HEIGHT * 5/6
            handPlayer1 = new WarHand(WINDOW_WIDTH / 2, WINDOW_HEIGHT - 500);
            handPlayer2 = new WarHand(WINDOW_WIDTH / 2, WINDOW_HEIGHT - 100);

            //while (!deck.Empty)
            for (int i = 0; i < 2; i++)
            {
                handPlayer1.AddCard(deck.TakeTopCard());
                handPlayer2.AddCard(deck.TakeTopCard());
            }

            // create the player battle piles
            // WINDOW_HEIGHT / 3 and WINDOW_HEIGHT * 2/3
            pilePlayer1 = new WarBattlePile(WINDOW_WIDTH / 2, WINDOW_HEIGHT - 380);
            pilePlayer2 = new WarBattlePile(WINDOW_WIDTH / 2, WINDOW_HEIGHT - 220);

            // create the player winner messages
            // WINDOW_WIDHT * 3 / 4, WINDOW_HEIGHT / 6 AND WINDOW_HEIGHT * 5 / 6
            winnerPlayer1 = new WinnerMessage(Content, WINDOW_WIDTH - 200, WINDOW_HEIGHT - 500);
            winnerPlayer2 = new WinnerMessage(Content, WINDOW_WIDTH - 200, WINDOW_HEIGHT - 100);

            // create the menu buttons
            // WINDOW_WIDTH / 5, WINDOW_HEIGHT / 4
            flipCards = new MenuButton(Content, "flipbutton", WINDOW_WIDTH - 650,
                                       WINDOW_HEIGHT - 450, GameState.Flip);
            // WINDOW_WIDTH / 5, WINDOW_HEIGHT * 3 / 4
            quitGame = new MenuButton(Content, "quitbutton", WINDOW_WIDTH - 650,
                                      WINDOW_HEIGHT - 150, GameState.Quit);
            // WINDOW_WIDTH / 5, WINDOW_HEIGHT / 2
            collectWinnings = new MenuButton(Content, "collectwinningsbutton", WINDOW_WIDTH - 650,
                                             WINDOW_HEIGHT - 300, GameState.Play); // GameState.CollectWinnings
            collectWinnings.Visible = false;
        }
        /// <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);

            // create the deck object and shuffle
            Deck deck = new Deck(Content, 0, 0);

            deck.Shuffle();

            // create the player hands and fully deal the deck into the hands
            player1Hand = new WarHand(graphics.PreferredBackBufferWidth / 2, graphics.PreferredBackBufferHeight / 6);
            player2Hand = new WarHand(graphics.PreferredBackBufferWidth / 2, graphics.PreferredBackBufferHeight * 5 / 6);

            while (!deck.Empty)
            {
                player1Hand.AddCard(deck.TakeTopCard());
                player2Hand.AddCard(deck.TakeTopCard());
            }

            // create the player battle piles
            player1BattlePile = new WarBattlePile(graphics.PreferredBackBufferWidth / 2, graphics.PreferredBackBufferHeight / 3);
            player2BattlePile = new WarBattlePile(graphics.PreferredBackBufferWidth / 2, graphics.PreferredBackBufferHeight * 2 / 3);

            // create the player winner messages
            player1Message = new WinnerMessage(Content, graphics.PreferredBackBufferWidth * 3 / 4,
                                               graphics.PreferredBackBufferHeight / 6);

            player2Message = new WinnerMessage(Content, graphics.PreferredBackBufferWidth * 3 / 4,
                                               graphics.PreferredBackBufferHeight * 5 / 6);

            // create the menu buttons
            flipButton = new MenuButton(Content, "flipbutton", graphics.PreferredBackBufferWidth / 5,
                                        graphics.PreferredBackBufferHeight / 4, GameState.Flip);

            collectWinningsButton = new MenuButton(Content, "collectwinningsbutton", graphics.PreferredBackBufferWidth / 5,
                                                   graphics.PreferredBackBufferHeight / 2, GameState.Play);
            collectWinningsButton.Visible = false;

            quitButton = new MenuButton(Content, "quitbutton", graphics.PreferredBackBufferWidth / 5,
                                        graphics.PreferredBackBufferHeight / 4 * 3, GameState.Quit);
        }
Ejemplo n.º 4
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);

            // create the deck object and shuffle
            deck = new Deck(Content, 100, 100);
            deck.Shuffle();
            for (int i = 1; i < 45; i++)
            {
                deck.TakeTopCard();
            }

            // create the player hands and fully deal the deck into the hands
            player1 = new WarHand((int)(graphics.PreferredBackBufferWidth / 2), (int)(graphics.PreferredBackBufferHeight * 0.2));
            player2 = new WarHand((int)(graphics.PreferredBackBufferWidth / 2), (int)(graphics.PreferredBackBufferHeight * 0.8));

            while (!deck.Empty)
            {
                player1.AddCard(deck.TakeTopCard());
                player2.AddCard(deck.TakeTopCard());
            }

            // create the player battle piles
            battlePile1 = new WarBattlePile((int)(graphics.PreferredBackBufferWidth / 2), (int)(graphics.PreferredBackBufferHeight * 0.4));
            battlePile2 = new WarBattlePile((int)(graphics.PreferredBackBufferWidth / 2), (int)(graphics.PreferredBackBufferHeight * 0.6));

            // create the player winner messages
            playerOneWin = new WinnerMessage(Content, (int)(graphics.PreferredBackBufferWidth * 0.7), (int)(graphics.PreferredBackBufferHeight * 0.2));
            playerTwoWin = new WinnerMessage(Content, (int)(graphics.PreferredBackBufferWidth * 0.7), (int)(graphics.PreferredBackBufferHeight * 0.8));

            // create the menu buttons
            flipButton            = new MenuButton(Content, "flipbutton", (int)(graphics.PreferredBackBufferWidth * 0.2), (int)(graphics.PreferredBackBufferHeight * 0.3), GameState.Flip);
            collectButton         = new MenuButton(Content, "collectwinningsbutton", (int)(graphics.PreferredBackBufferWidth * 0.2), (int)(graphics.PreferredBackBufferHeight * 0.5), GameState.CollectWinnings);
            quitButton            = new MenuButton(Content, "quitbutton", (int)(graphics.PreferredBackBufferWidth * 0.2), (int)(graphics.PreferredBackBufferHeight * 0.7), GameState.Quit);
            flipButton.Visible    = false;
            collectButton.Visible = false;
            quitButton.Visible    = false;
        }
Ejemplo n.º 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);

            // create the deck object and shuffle
            deck = new Deck(Content, 0, 0);
            deck.Shuffle();

            // create the player hands and fully deal the deck into the hands
            playerOneHand = new WarHand(graphics.PreferredBackBufferWidth / 2, graphics.PreferredBackBufferHeight / 6);
            playerTwoHand = new WarHand(graphics.PreferredBackBufferWidth / 2, graphics.PreferredBackBufferHeight / 6 * 5);
            while (!deck.Empty)
            {
                playerOneHand.AddCard(deck.TakeTopCard());
                playerTwoHand.AddCard(deck.TakeTopCard());
            }

            // create the player battle piles
            playerOnePile = new WarBattlePile(graphics.PreferredBackBufferWidth / 2, graphics.PreferredBackBufferHeight / 3);
            playerTwoPile = new WarBattlePile(graphics.PreferredBackBufferWidth / 2, graphics.PreferredBackBufferHeight / 3 * 2);

            // create the player winner messages
            playerOneMessage = new WinnerMessage(Content, graphics.PreferredBackBufferWidth / 4 * 3, graphics.PreferredBackBufferHeight / 3);
            playerTwoMessage = new WinnerMessage(Content, graphics.PreferredBackBufferWidth / 4 * 3, graphics.PreferredBackBufferHeight / 3 * 2);


            // create the menu buttons            
            flipButton = new MenuButton(Content, "flipbutton", 200, 150, GameState.Flip);
            quitButton = new MenuButton(Content, "quitbutton", 200 ,450 , GameState.Quit);
            collectButton = new MenuButton(Content, "collectwinningsbutton", 200, 150, GameState.CollectWinnings);

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

        }
Ejemplo n.º 6
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);

            // create the deck object and shuffle
            Deck deck = new Deck(Content, 0, 0);
            deck.Shuffle();

            // create the player hands and fully deal the deck into the hands
            for(int i = 0; i < 3;i ++ )/*while (deck.Empty != true)*/
            {
                player1.AddCard(deck.TakeTopCard());
                if (deck.Empty != true)
                {
                    player2.AddCard(deck.TakeTopCard());
                }
            }
            // create the player battle piles
            wbp1 = new WarBattlePile(400, 200);
            wbp2 = new WarBattlePile(400, 400);

            // create the player winner messages
            wmessage1 = new WinnerMessage(Content, 600, 100);
            wmessage2 = new WinnerMessage(Content,600,500);

            // create the menu buttons
            quitbutton = new MenuButton(Content, "quitbutton", 180, 450,GameState.Quit);
            flipbutton = new MenuButton(Content, "flipbutton", 180, 150,GameState.Flip);
            collectwinningsbutton = new MenuButton(Content, "collectwinningsbutton", 180, 300, GameState.CollectWinnings);

            // initialized the menu buttons
            collectwinningsbutton.Visible = false;
            flipbutton.Visible = true;
            quitbutton.Visible = true;
        }
        /// <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);

            // create the deck object and shuffle
            Deck deck = new Deck(Content, 100, 100);
            deck.Shuffle();

            // create the player hands and fully deal the deck into the hands
            playerOneHand = new WarHand(WINDOW_WIDTH / 2, 100);
            playerTwoHand = new WarHand(WINDOW_WIDTH / 2, WINDOW_HEIGHT - 100);

            for (int i = 0; i < 2; i++)
            {
                playerOneHand.AddCard(deck.TakeTopCard());
                playerTwoHand.AddCard(deck.TakeTopCard());
            }

            // create the player battle piles
            playerOneBP = new WarBattlePile(WINDOW_WIDTH / 2, 200);
            playerTwoBP = new WarBattlePile(WINDOW_WIDTH / 2, WINDOW_HEIGHT - 200);

            // create the player winner messages
            playerOneWM = new WinnerMessage(Content, WINDOW_WIDTH / 2 + 150, 100);
            playerTwoWM = new WinnerMessage(Content, WINDOW_WIDTH / 2 + 150, WINDOW_HEIGHT - 100);

            // create the menu buttons
            flipButton = new MenuButton(Content, "flipbutton", 150, 150, GameState.Flip);
            quitButton = new MenuButton(Content, "quitbutton", 150, 450, GameState.Quit);
            collectWinnings = new MenuButton(Content, "collectwinningsbutton", 150, 300, GameState.CollectWinnings);
        }