Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BlackJack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Amigoni Nicholas (Student Com20)
BlackJack
Commits
b233d35f
Commit
b233d35f
authored
3 years ago
by
LeoKerschbaumer
Browse files
Options
Downloads
Patches
Plain Diff
updated readme
parent
c24c11a5
Branches
gui
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
LICENSE.txt
+0
-1
0 additions, 1 deletion
LICENSE.txt
README.md
+42
-62
42 additions, 62 deletions
README.md
with
42 additions
and
63 deletions
LICENSE.txt
deleted
100644 → 0
+
0
−
1
View file @
c24c11a5
The projects license
\ No newline at end of file
This diff is collapsed.
Click to expand it.
README.md
+
42
−
62
View file @
b233d35f
...
...
@@ -4,10 +4,7 @@
Marco Sciacovelli, Lisa Mussner and Leo Kerschbaumer
## What is the project about?
Our project is a BlackJack game implemented in Java using JavaFX.
For reference please refer to https://en.wikipedia.org/wiki/Blackjack.
We are still working on multiplayer for this application but that feature is still
in development.
BackJack, a game that keeps you entertained during the hardest times. Even if you have no friends or your internet
connection is lost, this game is always playable
*
and you are in safe hands, since you are not playing with real money.
...
...
@@ -34,19 +31,6 @@ We wish you a lot of fun!
*
you might need electricity
## 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
## Instructions
these might change when using an IDE (eg. IntelliJ or Eclipse), where you can run the maven goals from the IDE directly.
...
...
@@ -83,43 +67,51 @@ please message us on LeKerschbaumer@unibz.it
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
may be clicked to show the game
'
s 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
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.
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
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
To implement this project we use the
`org.openjfx`
plugin. It can be used to design user interfaces for Java.
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.
.
.
.
while the logic for the GUI resides in the controller.
Multiplayer is still in development (see Multiplayer branch).
### programming techniques used
1.
Collections
-
to save the cards in the hands and deck
2.
Custom Exception
-
for when the player has lost all of his money and is bankrupt
3.
Exception handling
-
for example when working with I/O
4.
Method overriding
-
inherited methods for example start in the controller(inherited from Application)
5.
Lambdas
-
among other things for event listeners
6.
Streams
-
ex. as foreach loops
7.
File I/O
-
to obtain the cards and music/sound effects
8.
Regex
-
to check the username
9.
Observer pattern
-
when using event listeners
10.
Test hooks
-
for setting the testing environment
11.
serialization
-
for logging the events
## 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.
a mind
map and other functionality which helped us keep track of what needed to be done.
Git helped us share our code. We used feature branches to develop different parts of the
project for example the logic or the gui.
...
...
@@ -127,10 +119,10 @@ project for example the logic or the gui.
###challenges
-
Marco: I have some experience in working with Java and also in organizing and working on smaller projects, but to
design a UI using JavaFX is a challenge everytime. Especially something like this that should responsively
layout the
content in order to fit the screen
fully
. Then when we thought the project was done we encountered problems when
design a UI using JavaFX is a challenge every
time. Especially something like this that should responsively
display
the
content in order to fit the screen. Then when we thought the project was done we encountered problems when
packaging with maven, and so we had to reroute all the resources to the class reference. Another challenge I faced,
where the transition, since I had used them before. But anything can be fixed with a good dose of Stackoverflow and a
where the transition
s
, since I had used them before. But anything can be fixed with a good dose of Stackoverflow and a
good cup of coffee.
-
Lisa: Since I am new to programming, implementing an own project from the beginning to the end was a challenge, since
...
...
@@ -140,23 +132,11 @@ project for example the logic or the gui.
professional. Therefore, I watched YouTube videos, went on Stackoverflow and looked up solutions on different other
webpages. Marco gave also some good inputs.
-
Leo: runnable jar,..
## Licensing
-
Leo: I have worked with Java before but have never used Maven to generate a runnable JAR file. It turned out to be
quite problematic. I used the maven-assembly plugin, but the jar file would not execute from the terminal.
No error messages, no warnings, no application started. I then tried the maven-shade plugin. However, this time
it would not recognize the resources (sound files and images). The internet led to nothing and colleagues used
the same exact packaging method with success. It turned(thanks Roland for that) out we had to use getResource instead
of the paths directly.
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.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment