Here is the program:
Reflection:
-
I pulled out the functions for Nintendo game body drawing, gray screen drawing, screen light drawing, button drawing, keypad drawing, and speaker drawing from main.py into a separate file called screen.py. In the screen.py, I also created a function called draw_nintendo() that houses the six functions above. I did this because all of those functions are part of the screen setup. The codes are long but not relevant to the game itself.
-
I also created a separate file called pieces.py to house the seven types of pieces and their width. The pieces codes take a lot of space in the main.py and prevents the readers from understanding the main body of the code easily.
-
I created an additional file called playscreen.py to house draw_screen, draw_gride, and fill_cell functions. All of the aboved functions are finished by turtle fin and are the main pieces of the game display.
-
I fixed the issue with the game where the āZā can go exceed the screen on the right while the āIā cannot get to the last column of the screen. I fixed it by introducing another library called piece_width.