https://github.com/zjiayao/bigtwogame
Multiplayer Big Two card game in Java
https://github.com/zjiayao/bigtwogame
card-game java socket
Last synced: 12 months ago
JSON representation
Multiplayer Big Two card game in Java
- Host: GitHub
- URL: https://github.com/zjiayao/bigtwogame
- Owner: zjiayao
- License: gpl-3.0
- Created: 2017-11-22T08:21:35.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-22T11:07:47.000Z (over 8 years ago)
- Last Synced: 2025-07-01T13:55:26.896Z (about 1 year ago)
- Topics: card-game, java, socket
- Language: Java
- Homepage:
- Size: 1.63 MB
- Stars: 3
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Big Two Game with `Java`
[](https://github.com/zjiayao/BigTwoGame/blob/master/LICENSE)
[](https://travis-ci.org/zjiayao/BigTwoGame/)
[](https://ci.appveyor.com/project/zjiayao/bigtwogame)
[](http://htmlpreview.github.io/?https://github.com/zjiayao/BigTwoGame/blob/master/doc/index.html)
[](https://gitter.im/zjiayao/BigTwoGame/)

## Introduction and Features
The "Big Two" game is a popular card game of four players.
"Big Two Game with `Java`", as the name suggested, is powered by `Java`.
This game supports the following features:
- Pleasant UI/UX

- Multi-player via Socket I/O (both localhost/LAN/WAN)

- Shortcut Keys
Multiple shortcuts are supported for better
enjoying the game:
| Key | Function |
|:------------------:|:----:|
| ` + ` | Play |
| `` | Pass |
| ` + ` | Hint |
| `` | Chat |
- Game Hints
Got stuck of what can be played? No problem,
a hinter comes to rescue:

- Asynchronous Chatting
Chat with your friends while gaming!

## Installation
Before proceed, you should make sure you have a working `Java` distribution
of version greater than `JSE-6`. To obtain a latest copy, one may
visit the [Oracle's JSE page](http://www.oracle.com/technetwork/java/javase/overview/index.html).
First, clone this repo using `git`:
git clone https://github.com/zjiayao/BigTwoGame
Then one may compile from source:
cd BigTwoGame/src && javac BigTwoClient.java && javac BigTwoServer.java
That's all!
## Usage
Big-Two Game supports multi-player, and can be invoked in a LAN environment. In
this section, we run the server and clients on `localhost` for illustration.
First compile the source (see previous section) and navigate
to the `src` folder:
cd src
then invoke the `server`:
java ./BigTwoServer &
On a Windows machine, the command is analogous:
run java ./BigTwoServer
This command spawns a dedicated server window,
by default, listens to the socket at `localhost`
with port being `2397`.

Noted each game requires four players, hence
we run four clients:
java ./BigTwoClient &
# ...
First specify your name and join the server:


After game ends, the result is prompted:

After all players view the result, a new game is about
to begin.
## Development
You are welcome to submit a PR, be sure to check
the thorough [documentation](http://htmlpreview.github.io/?https://github.com/zjiayao/BigTwoGame/blob/master/doc/index.html) of the implementation.
### Software Structure
Essentially, the game is modeled by a handful of
classes and interfaces, concretely:

A [much more detailed class diagram](http://htmlpreview.github.io/?https://github.com/zjiayao/BigTwoGame/blob/master/doc/doc-files/Class%20Diagram.svg) can also be found
in the `doc/doc-files` subfolder, which listed
all major APIs.
As such, the core use cases are summarized below:

### UI/UX Design
The core philosophy for the design is simplicity,
which infact turns out pretty well. The GUI is powered
by `java.swing`, mostly `JPanel` and its subclasses.
An overview of the components is outlined below:

## Disclaimer
This project has been submitted in partial fulfillment
for the course *OOP and Java* offered by HKU, 2016-17.