Beispiel #1
0
        private Vector2 GetChipOffSet(int playerIndex, bool secondHand)
        {
            Vector2 offSet = Vector2.Zero;

            CardsGame.UI.BlackJackTable table = ((CardsGame.UI.BlackJackTable)cardGame.GameTable);
            offSet = table.RingOffSet + new Vector2(table.RingTexture.Bounds.Width - blankChip.Bounds.Width, table.RingTexture.Bounds.Height - blankChip.Bounds.Height) / 2f;

            if (secondHand == true)
            {
                offSet += secondHandOffSet;
            }
            return(offSet);
        }
Beispiel #2
0
        public override void Draw(GameTime gameTime)
        {
            spriteBatch.Begin();

            for (int chipIndex = 0; chipIndex < chipAssets.Count; chipIndex++)
            {
                spriteBatch.Draw(chipAssets[assetNames[chipIndex]], positions[chipIndex], Color.White);
            }

            CardsGame.Players.BlackjackPlayer player;

            for (int playerIndex = 0; playerIndex < players.Count; playerIndex++)
            {
                CardsGame.UI.BlackJackTable table = (CardsGame.UI.BlackJackTable)cardGame.GameTable;
                Vector2 position = table.RingOffSet + new Vector2(table.RingTexture.Bounds.Width, 0);
                player = (CardsGame.Players.BlackjackPlayer)players[playerIndex];
                spriteBatch.DrawString(cardGame.Font, "$" + player.BetAmount.ToString(), position, Color.White);
                spriteBatch.DrawString(cardGame.Font, "$" + player.Balance.ToString(), position + new Vector2(0, 30), Color.White);
            }

            spriteBatch.End();
            base.Draw(gameTime);
        }