Blackjack v3 with SimpleGui and Python

So this is my latest version of Blackjack with took me a few hours to get right.  The big difference is the dealer's first card. This card is not shown until the end of the round. It looks simple but it took me some time to figure this out.



The issue was solved with a boolean expression which was used to determine when to use the back card image.  I achieved this by adding another method in the Card class. While this was a simple solution, it led to a number of problems.

In the Hand class, I created a call to draw the back card if the game was in play.However, this led to both dealer's and plaver's cards being covered. (see below)




I fixed this for the player but I then had the problem that the dealer's cards  were covered when I only needed 1 card covered.  This was a problem that I couldn't solve easily and after some time I thought about giving up.

I then decided to see if I could draw 2 face cards for the dealer and then put draw a 3rd image card - the back card- on top of the first fact card.  After some time this became the easiest solution. The problem the was getting the right coordinates to get the back card image on top of the 1st dealer card. (See below)


After some time this became the solution. (See below)  This means that I am almost done with the assignment. I just a have to add the scoring.  It has been a lot of work but fun!









Comments

Popular posts from this blog

Space Wars- Python 3

Maze Game in Python using Turtle