Game: Big Two
Welcome to the Big Two Game! This project is a graphical user interface (GUI) implementation of the popular card game Big Two, also known as Deuces or Pusoy Dos using Qt and C++. The objective of the game is to be the first player to get rid of all your cards that requires you to place increasingly higher-ranked cards, and always of whatever number combination the round began with.
Overview
Qt is a powerful, cross-platform framework widely celebrated for creating sleek, high-performance desktop and mobile interfaces. By pairing Qt’s robust GUI capabilities with the speed and object-oriented structure of C++, this project brings the tactile, fast-paced experience of Big Two straight to your desktop.
Whether you are looking to understand the mechanics of card-game AI, explore event-driven programming, or see how custom graphics assets are managed in a C++ environment, this project serves as an excellent blueprint.
Core Features and Functionality
In this project, we have implemented a graphical user interface (GUI) version of the Big Two card game using Qt framework. We have implemented all basic requirements and all bonus features, including:
- Basic Requirements:
- GUI
- Setting stage
- Player number
- Mode
- Start game
- Exit
- Playing stage
- Play big two
- Card that played last round
- Show PASS
- Sorted cards of yours
- Scoring stage
- List score of each player
- Player getting 50 first is winner
- Award stage
- Display winner
- Screen size
- Width : 1080
- Height : 960
- Setting stage
- Poker cards
- A total of 52 cards
- 4 suits: Spades, Hearts, Diamonds, Clubs
- 13 numbers: A, 2 to 10, J, Q, K
- Game Rules
- Each player is dealt an equal number of cards, face down.
- Begin the game by playing combination include the three of club.
- Card are played in a counterclockwise direction.
- The next player can either pass or follow the previous combination with higher-ranked.
- If choosing to pass in this turn, you can’t play any card until this turn end.
- When the other three players all pass, the turn ends.
- Once everyone besides you have passed, you can play new combination and start a new turn.
- The first player who runs out of cards can get scores and a new round begin.
- Player who get 50 scores first is winner
- Game Logic
- The suits are ranked: Spades > Hearts > Diamonds > Clubs
- The card numbers are ranked: 2 > A > K > Q > J > 10 > … > 3
- The priority of comparison: Numbers > Suits, E.g. Club 4 > Spade 3
- Card combinations
- Single card
- Pair
- Straight
- Full house
- Four of a kind
- Straight flush
- Scoring method
- Score equals to summation of the number of the losers’ remaining cards
- If a loser has at least one big two in the remaining hand, the winner can get double score from this loser.
- GUI
- Bonus Features:
- Sound effect
- Backgound music
- Button clicks
- Playing cards
- Winner effect
- Player vs. Computer
- The computer must play cards according to the rules mentioned earlier.
- The total number of players(include computers) in the game can be set as 2~4.
- Setting total number of players in setting stage.
- Show hints for combinations that can be played from the hand.
- If player doesn’t play any card within 10 seconds, then the system will automatically play a card.
- Must play cards according to the rules mentioned earlier
- Add joker cards (2 cards) into the game.
- Joker card can be seen as any card except big two.
- Joker pair is the biggest combination that can be played at any time.
- Setting this mode in setting stage.
- Swap card mode (choose mode in the setting stage)
- In the begining of each round, each player chooses two cards and passes to the player on the right.
- In the begining of each round, collect two cards from each player, shuffle those cards and deal to each player.
- Sound effect
How to Compile
To compile the code using qmake, follow these steps:
- Ensure that you have Qt installed and properly configured on your system, including the setup of qmake.
- Open a terminal or command prompt.
- Navigate to the directory containing the source code files.
- Create a new folder named
buildand navigate to it.
mkdir build && cd build - The folder structure will look like this:
bigtwo ├── README.md ├── report.pdf ├── build ├── BigTwo │ ├── card.cpp │ ├── card.h │ ├── BigTwo.pro ... - Run the following command to generate the makefile:
qmake -o Makefile ../BigTwo/ - Run
maketo compile the code:
make
This will create an executable file namedBigTwo.
Running the Executable
Once the code is compiled, you can run the game by executing the generated executable file, which is named BigTwo.
Conclusion
This project highlights how vintage card games can be given a modern digital life using C++ and Qt. Looking ahead, future iterations of this project could include local LAN multiplayer capabilities using Qt Network, and a hint system to help beginners learn optimal Big Two strategies.