Graphics Version of Twenty One

You can use these gifs of dice faces or you can choose whatever others you like. They must be called 1.gif, 2.gif, 3.gif, etc. The gif for the "pass" move must be named 0.gif You won't have to upload them; we will have our own files with those names.

You should NOT have to change the program logic in any substantial way. Loops are still where they are; ifs are still the same logic.

All input statements and print statements have to be replaced by a graphics library equivalent. Hint: you will use both Entry objects and win.getMouse() for inputs.

Make sure that the function cleans up after itself. All prompts, messages and Entry boxes should be undrawn before the function returns.

Feel free to be creative with the design of the game. Colors, fonts, locations, etc. are up to you. The only requirements are that you have the information on the screen at the appropriate times as shown in the screen shots below.

Screen Shots

Changes to existing functions

Changes to play_turn:

Changes to main function:

Changes to pass_or_roll:

Two New Functions

Cleanup

You notice in the screen captures that all the information that is displayed is "clean". This means that it is NOT just displayed on top of the old values that were there. When the Points changes from 2 to 3, the 3 is not displayed on top of the 2. You must use setText here. Hint: set up your Text objects before you enter the main game loop. Put blank strings in them and give them their locations.