Skip to content
Snippets Groups Projects
README.md 4.27 KiB
Newer Older
LeoKerschbaumer's avatar
LeoKerschbaumer committed
Marco Sciacovelli, Lisa Mussner and Leo Kerschbaumer
## What is the project about?
LeoKerschbaumer's avatar
LeoKerschbaumer committed
Our project is a BlackJack game implemented in Java using JavaFX.
For reference please refer to https://en.wikipedia.org/wiki/Blackjack.
Leo Kerschbaumer's avatar
Leo Kerschbaumer committed
We are still working on multiplayer for this application but that feature is still
in development.
LeoKerschbaumer's avatar
LeoKerschbaumer committed
The user can enter a username and play 
against the dealer. Lisa moch du des bitte ;)
LeoKerschbaumer's avatar
LeoKerschbaumer committed

LeoKerschbaumer's avatar
LeoKerschbaumer committed
## programming techniques used
1. Collections
2. Custom Exception
3. Exception handling
4. Method overriding
5. Lambdas
6. Streams
7. File I/O
8. Regex
9. Observer pattern
10. Test hooks
11. serialization
LeoKerschbaumer's avatar
LeoKerschbaumer committed
these might change when using an IDE (eg. IntelliJ or Eclipse), where you can run the maven goals from the IDE directly.
LeoKerschbaumer's avatar
LeoKerschbaumer committed
###download or clone the project
1. Download the project from gitlab or clone it using ssl or https.
LeoKerschbaumer's avatar
LeoKerschbaumer committed
### install dependencies
LeoKerschbaumer's avatar
LeoKerschbaumer committed
2. Run `mvn install` to install the maven dependencies
LeoKerschbaumer's avatar
LeoKerschbaumer committed
### Command Line
3. `cd` into the project's root directory
   
### compile the project
4. Run `mvn clean compile` to compile the project   
LeoKerschbaumer's avatar
LeoKerschbaumer committed
### test the project
5. Run `mvn test` to run the tests.
LeoKerschbaumer's avatar
LeoKerschbaumer committed
### run the project
6. Run `mvn javafx:run` to run the app.
LeoKerschbaumer's avatar
LeoKerschbaumer committed
## Problems running the application ?
please message us on LeKerschbaumer@unibz.it

- Java 15 or above https://www.oracle.com/java/technologies/javase-downloads.html
- maven download: https://maven.apache.org/download.cgi; installation guide: https://maven.apache.org/install.html
LeoKerschbaumer's avatar
LeoKerschbaumer committed

## Usage
This application is an implementation of the popular card game Blackjack.
The user enters a username and clicks on `start`. The application then proceeds to the
main scene. If the player is unsure about the rules the info button in the top left corner
may be clicked to show the games rules. The chips at the top of the screen are clickable buttons with which the user can
bet virtual money. In the top right corner the player's money can be seen. Bets and wins
are subtracted and added to the player's money accordingly. When the player has carried out
the bets, he can press the `ready` button, and the initial card will be dealt. The player
may press `hit` or `stand` now. By pressing hit another card will be dealt. By pressing stand
on the other hand, the player's turn ends, and the dealer may request further cards.
At the end of the wound a pop up appears and informs the player about the result. Afterwards
two options are presented:
- continue
- exit the game

## Implementation
To implement this project we used the javaFX. 
Leo Kerschbaumer's avatar
Leo Kerschbaumer committed
1. We used `collections` (lists) to save the cards in hand and deck.
2. Custom Exception are thrown when a certain case arrives during the game
   ex. when no bet is set and the player wants to start the round
3. Exceptions are handled so the application does not crash unexpectedly
Leo Kerschbaumer's avatar
Leo Kerschbaumer committed
4. Method overriding ex. toString..
5. Lambdas for event listeners
6. Streams
7. File I/O for card backs
8. Regex to check username does not contain special characters
9. Observer pattern by using event listeners
10. Test hooks
11. serialization for log
LeoKerschbaumer's avatar
LeoKerschbaumer committed

Leo Kerschbaumer's avatar
Leo Kerschbaumer committed
We use some basic classes as logic (Hands, Player, Deck, Card). The GUI uses JavaFX
while the logic for the GUI resides in a controller. 
.
.
.
Leo Kerschbaumer's avatar
Leo Kerschbaumer committed
## Our experience in this project
We organized ourselves using an application called Clickup. It allows us to create
tasks and notes as well as assign those tasks to a team member. It also features 
a mindmap and other functionality which helped us to keep track of what needed to be done.
LeoKerschbaumer's avatar
LeoKerschbaumer committed

Leo Kerschbaumer's avatar
Leo Kerschbaumer committed
Git helped us share our code. We used feature branches to develop different parts of the
project for example the logic or the gui. 
LeoKerschbaumer's avatar
LeoKerschbaumer committed

Leo Kerschbaumer's avatar
Leo Kerschbaumer committed
###challenges
LeoKerschbaumer's avatar
LeoKerschbaumer committed

Leo Kerschbaumer's avatar
Leo Kerschbaumer committed
- Marco:
  
- Lisa:
  
- Leo:


## Licensing

Copyright 2021 twentyonecoders

Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy
of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.

A copy of the license is available in the repository's license.txt file.