Luigi Picture Poker
Software Design
Skills Advanced: Python, PyGame, Git
Objective: Recreate the classic Luigi Picture Poker minigame with PyGame in a Model-View-Controller software architecture.
In this project, I teamed up with 2 other students to build a Pygame version of the fun minigame: Luigi Picture Poker. We followed the Model-View-Controller (MVC) game architecture to practice clear software design and documentation, and I focused on the model portion of the game.
The model portion of the game includes all of the internal tracking for the gameplay sequence. The most essential components are the card and hand hierarchy, currency and betting tracking, deck tracking, swapping, and hand classification and comparison steps.
The player’s wallet is updated according to their bets, and money is awarded based on the value of their winning hand, with better hands being rewarded with more money. The deck is a random list of the same number of every card type, and the first 5 in the list are removed and assigned to the player’s hand, and repeated for Luigi. At the start of each round, a new full random deck is generated to ensure that cards are always available, simulating replacing all the cards used in the previous round and shuffling the deck.
Combining these tracking steps with the visual and user-input components created by my teammates, we were able to make a fun, functional game.
In Luigi Picture Poker, you play a simplified 5-card draw game against Luigi with a custom card hierarchy. The game includes dealing, betting, swapping, and payout phases. Luigi deals you and himself 5 cards each face down. You are prompted to bet the number of coins you would like, and then you can look at your own hand. You can choose which cards you’d like to swap for new cards from the deck, and then Luigi makes his swaps and reveals his own hand. The hands are compared, and the appropriate payout is given depending on a win or a loss.
Each card and hand type is assigned a numerical value, and the hands are classified and compared to determine the winner of the round. Card value is used in tiebreakers if both players have the same hand type. True ties are also possible if the hands are identical.
The swap phase starts with the controller portion of the architecture to allow the user to pick how many cards to swap, and then that number of cards is selected from the top of the deck and replaces the selected cards in the hand, which are simply overwritten.