Game Preview

Team Roles
- Jian Mejia – Main game screen & mechanics
- Christian Perez – Stats & menu screens
- Sean Perez – Demo video
Requirements & Setup
- Python 3 – Download at python.org
- Pillow library – Install with
pip install Pillow
Card images are sourced from Google Code’s Vector Playing Cards archive.
Game Flow
The overall flow is managed through Tkinter frames (scrnTitle
, scrnBlackjack
, scrnStats
):
- Title Screen: Player enters starting balance and begins the game:contentReference[oaicite:0]{index=0}.
- Betting Window: Player chooses how much to bet. Validation ensures the bet is within the balance:contentReference[oaicite:1]{index=1}.
- Initial Deal: Player and dealer each get 2 cards. Dealer’s second card is hidden:contentReference[oaicite:2]{index=2}.
- Player Turn: Player can Hit (draw) or Stand (end turn). Aces are handled as 1 or 11:contentReference[oaicite:3]{index=3}.
- Dealer Turn: Dealer reveals hidden card and must draw until ≥16:contentReference[oaicite:4]{index=4}.
- Result: Balance updates depending on outcome (Blackjack, Win, Loss, Push):contentReference[oaicite:5]{index=5}.
- Stats Screen: Shows Rounds Won/Lost. Option to Play Again resets counters:contentReference[oaicite:6]{index=6}.
Card Mechanics & Display
The deck is represented as a cardArray
of Tkinter Label objects, each linked with:
- Card image (via Pillow + Tkinter)
- Card value (Ace = 1, J/Q/K = 10):contentReference[oaicite:7]{index=7}
- Position (X, Y placement on screen):contentReference[oaicite:8]{index=8}
Cards are drawn randomly from cardArray
and removed once dealt, preventing duplicates.
Ace logic: totals are calculated both with Ace as 1 and Ace as 11; the best valid hand ≤21 is chosen as bestHand
:contentReference[oaicite:9]{index=9}.
Betting & Balance System
balance
tracks the player’s money. tempBalance
and tempBet
store Entry widget inputs.
The bettingWindow ensures valid wagers before cards are dealt:contentReference[oaicite:10]{index=10}.
Results update balance accordingly:
- Blackjack: Bet returned + 50% bonus:contentReference[oaicite:11]{index=11}.
- Player Wins: Bet returned (1:1 payout):contentReference[oaicite:12]{index=12}.
- Dealer Wins: Bet subtracted:contentReference[oaicite:13]{index=13}.
- Push: Bet returned unchanged:contentReference[oaicite:14]{index=14}.
Outcomes & Rules
- Blackjack: Hand equals 21 on deal → automatic win:contentReference[oaicite:15]{index=15}.
- Bust: Hand exceeds 21 → automatic loss:contentReference[oaicite:16]{index=16}.
- Dealer Logic: Dealer hits until 16, then stands:contentReference[oaicite:17]{index=17}.
- Comparison: Higher valid hand wins, equal totals = Push:contentReference[oaicite:18]{index=18}.
Stats & End Screen
Wins, losses, and total rounds are tracked as roundsWon
, roundsLost
, roundsPlayed
.
After running out of balance, the Stats screen shows totals and offers “Play Again”:contentReference[oaicite:19]{index=19}.