Console Conqueror is a multiplayer card game with client-server architecture. Players connect to a server, join or create game rooms, configure cards with various abilities, and engage in turn-based combat using different strategies.
The system follows a client-server architecture with the following key components:
-
Server Side
- Server.java - Main server that listens for connections and manages game rooms
- ClientHandler.java - Handles individual client connections
- GameRoom.java - Represents a game room where players interact
-
Client Side
- Client.java - Connects to the server and manages communication
- GUI Components:
- InitFrame.java - Initial screen
- LobbyFrame.java - Room selection/creation
- GameFrame.java - Main game interface
-
Game Logic
- Cards system (
Card.java, TypeOfCard.java, Weapon.java) - Command pattern implementation for game actions
- Strategy pattern for attack strategies
- Cards system (
- Start the server by running Server.java
- Start the client by running Client.java
- Enter your username in the initial screen
- Choose to create a new room or join an existing one
- The host can start the game with the
/startcommand - Players configure their cards (4 cards per player)
- Turn-based gameplay begins, with players taking actions using commands
- Players can attack opponents, recharge weapons, or use special abilities
| Command | Description |
|---|---|
/start |
Start the game (host only) |
/attack <target> <cardName> <weapon> [strategy] |
Attack another player |
/rechargeWeapons |
Refill all weapons for use |
/endTurn |
End your current turn |
/skipturn |
Skip your turn |
/surrender |
Give up and exit the game |
/draw |
Request a draw |
/say <message> |
Send a message to all players |
/exit |
Leave the game room |
Each card has:
- A type (FIRE, WATER, AIR, etc.)
- A name
- An image
- 5 weapons with different attack values
- Life points (starting at 100)
The game implements several attack strategies:
RandomDuplex- Doubles a random attack valueRandomCombination- Combines with a random card for maximum effectBestCombination- Uses best values from all cardsAverage- Uses average values from all cardsOptimal- Uses maximum values for each type
The game uses Java socket programming for network communication:
- Server listens on port 8060
- Messages are passed as plain text
- Chat messages and commands are distinguished by format
Card weapons are configured with random values between ranges defined in config.txt:
minValue- Minimum attack valuemaxValue- Maximum attack value
The game offers a graphical user interface with:
- Chat system for communication
- Card display area
- Command input area
- Status displays showing player statistics
Game actions use the Command pattern:
CommandManager- Manages available commandsCommandinterface - Base for all commands- Specific command implementations (Attack, Surrender, etc.)
Potential areas for improvement:
- Enhanced card visualization
- More complex strategies
- Improved game balance
- Additional card types and weapons
- Rankings and persistent statistics
- Java 22
- Maven for dependency management
- Swing for GUI components
The project follows a package structure with:
org.abno- Base packageorg.abno.logic- Game logicorg.abno.gui- User interface componentsorg.abno.socket- Networking code