Description
This issue addresses several bugs, compatibility problems, and usability improvements in the \Color_Game\ project:
- Missing Icon Crash: \main.py\ calls \window.iconbitmap("color_game_icon.ico"), but \color_game_icon.ico\ does not exist in the repository, resulting in an unhandled _tkinter.TclError\ exception on startup.
- Relative File Path Resolution: \highest_score.txt\ is opened using a relative string without resolving relative to the script directory, causing the score file to be written/read from whichever directory the terminal is in rather than \Color_Game/.
- Start Keypress Scoring Evaluation Bug: When the player presses Enter on initial start,
ext_colour()\ evaluates \e.get()\ against \colours[1]\ before any color text has even been displayed on the screen.
- Multiple \Tk()\ Roots: \scoreshow()\ initializes a new \ k.Tk()\ instance alongside the existing root window, causing Tkinter root duplication and resource management issues.
- Lack of Replay / Reset Mechanism: Once the timer expires, there was no seamless way to restart the game without terminating and restarting the script.
- Incomplete README: \README.md\ was minimal (only 5 lines) and lacked prerequisites, usage instructions, and feature details.
Proposed Fixes
- Add existence check and safe exception handling for \iconbitmap.
- Use \os.path.dirname(os.path.abspath(file))\ for dynamic and robust path resolution of \highest_score.txt.
- Fix the game start and scoring logic so the first Enter starts the timer and displays the first prompt without evaluating unprompted input.
- Replace secondary \ k.Tk()\ with \messagebox.showinfo\ and provide a replay/reset option.
- Expand \README.md\ to follow the repository standard documentation format.
Description
This issue addresses several bugs, compatibility problems, and usability improvements in the \Color_Game\ project:
ext_colour()\ evaluates \e.get()\ against \colours[1]\ before any color text has even been displayed on the screen.
Proposed Fixes