README.md 2.99 KB
Newer Older
Anders H. Rebner's avatar
Anders H. Rebner committed
1
# SpaceCheckers
Bård Olstad's avatar
Bård Olstad committed
2

Stefano Grisendi's avatar
Stefano Grisendi committed
3
This project was undertaken for the course TDT4240 - Software Architecture. The goal is to develop a game for Android and to get familiar with all that follows; Designing, testing and documenting all aspects related to its architecture.
Stefano Grisendi's avatar
Stefano Grisendi committed
4

Stefano Grisendi's avatar
Stefano Grisendi committed
5
We decided do make our own version of the game known as Chinese Checkers. It's a turn based game where every player has to move his pieces on a board. The first player whose pieces all reach the opposite side wins. 
Stefano Grisendi's avatar
Stefano Grisendi committed
6

Stefano Grisendi's avatar
Stefano Grisendi committed
7
We believe we achieved this goal as our project works fairly well. Players can join with their custom name, set up their lobby and once all participants are ready, play the game. There is room for improvment; We wanted to add more customization to the playstyle, like adding powerups, more game modes and more boards. Furthermore there are a few bugs that need to be addressed.
Stefano Grisendi's avatar
Stefano Grisendi committed
8

Stefano Grisendi's avatar
Stefano Grisendi committed
9
#### Technologies used
Stefano Grisendi's avatar
Stefano Grisendi committed
10

Stefano Grisendi's avatar
Stefano Grisendi committed
11
The game is developed through Android Studio. Both Java and Kotlin are used as programming languages. To simplify the process, we used the libraries [kryonet](https://github.com/EsotericSoftware/kryonet) to create the Client/Server communication sockets and [libGDX](https://github.com/libgdx/libgdx) to set up the game framework.
Stefano Grisendi's avatar
Stefano Grisendi committed
12

Stefano Grisendi's avatar
Stefano Grisendi committed
13
#### Content of the repository
Stefano Grisendi's avatar
Stefano Grisendi committed
14

Stefano Grisendi's avatar
Stefano Grisendi committed
15
The repository includes two Android Studio projects, "CheckersClient" and "CheckersServer". The first contains all the components required to program, build, run and install the client side application, which is the actual game we play on our Android devices. "CheckersServer" allows us to program and set up the server side part of the game instead. 
Stefano Grisendi's avatar
Stefano Grisendi committed
16
17
18
19

#### How to configure your server

- Open "CheckersServer" in Android Studio
Stefano Grisendi's avatar
Stefano Grisendi committed
20
- By default we use the port 54555 for TCP, to change this go to `core/src/com/mygdx/game/controller/ServerController` and change the line `server.bind(54555);` with the new desired value and save.
Stefano Grisendi's avatar
Stefano Grisendi committed
21
22
23
24
25

#### How to configure the client

To connect to a particular server you need its IP address. Once you have this address, you can set up your client.
- Open "CheckersClient" in Android Studio
Stefano Grisendi's avatar
Stefano Grisendi committed
26
- Go to `core/src/com/mygdx/game/controllers/NetworkController` and at the line `String IP4_LAN_ADDRESS = "xxx.xxx.xxx.xxx";` substitute xxx.xxx.xxx.xxx with the server's IP address. The line right below is `client.connect(10000, IP4_LAN_ADDRESS, 54555)`. Here change 54555 with a different TCP port if necessary.
Stefano Grisendi's avatar
Stefano Grisendi committed
27
28
29

#### How to run the applications

Stefano Grisendi's avatar
Stefano Grisendi committed
30
31
To build an APK in Android Studio click `Build` from the top menu and then select `Build Bundle(s)/Build APK(s)`>`Build APK(s)`. This will produce a package you can use to install the game on your device. 

32
Otherwise if you don't want to install the game on your personal device you can use Android Studio to run the client and/or server on an emulator by clicking the run button. If you do this, you should launch the server with the desktop launcher by choosing `DesktopLauncher` instead of `android` in the drop down menu next to the build hammer icon. This because emulators have their own private IP address which are not visible outside the emulator.