44import os
55from tkinter import messagebox , ttk , filedialog
66from blackboard import Blackboard as Bb
7+ from blackboard import dubel_sound , bravo_sound , round_sound , intro_music , ending_music
78
89# The program provides a graphical interface for the game Familiada.
910
@@ -111,7 +112,7 @@ def terminate_error(error_description):
111112style = ttk .Style (window1 )
112113window1 .protocol ("WM_DELETE_WINDOW" , lambda : exit_app (window1 ))
113114
114- #Create tab controler in the window1
115+ # Create tab controler in the window1
115116tabControl = ttk .Notebook (window1 )
116117
117118# Create a tab for every round
@@ -141,7 +142,7 @@ def terminate_error(error_description):
141142 answer_text = f"{ answer } { points } "
142143 answer_button = tkinter .Button (round_tab , text = answer_text , command = lambda round = i , answer = j : game1 .show_answer (round , answer ))
143144 answer_button .grid (row = j + 2 , column = 2 , sticky = "ew" )
144- tabControl .add (round_tab , text = f' Round { i + 1 } ' )
145+ tabControl .add (round_tab , text = f" Round { i + 1 } " )
145146
146147# Create a tab for showing team scores
147148score_tab = ttk .Frame (tabControl )
@@ -159,35 +160,52 @@ def terminate_error(error_description):
159160 input_answer .grid (row = w + 1 , column = t * 3 )
160161 input_points .grid (row = w + 1 , column = t * 3 + 1 )
161162 final_button .grid (row = w + 1 , column = t * 3 + 2 )
162- init_final_buttplug = tkinter .Button (final_tab , text = "Zacznij finał" , command = game1 .init_final_round )
163- init_final_buttplug .grid (row = 0 , column = 2 )
163+
164+ startfinal_button = tkinter .Button (final_tab , text = "Zacznij finał" , command = game1 .init_final_round )
165+ startfinal_button .grid (row = 0 , column = 2 )
166+
167+ doubled_answer = tkinter .Button (final_tab , text = "Dubel" , command = lambda : pygame .mixer .Sound .play (dubel_sound ))
168+ doubled_answer .grid (row = 7 , column = 2 )
169+
170+ labeltxt = "Odpowiedź:"
171+ label_answer = tkinter .Label (final_tab , text = labeltxt )
172+ label_answer .grid (row = 0 , column = 0 )
173+ label_answer1 = tkinter .Label (final_tab , text = labeltxt )
174+ label_answer1 .grid (row = 0 , column = 3 )
175+
176+ labeltxt1 = "Punkty:"
177+ label_points = tkinter .Label (final_tab , text = labeltxt1 )
178+ label_points .grid (row = 0 , column = 1 )
179+ label_points1 = tkinter .Label (final_tab , text = labeltxt1 )
180+ label_points1 .grid (row = 0 , column = 4 )
181+
164182tabControl .add (final_tab , text = "Finał" )
165183
166184# Create SFX tab
167185sfx_tab = ttk .Frame (tabControl )
168186
187+ button1 = tkinter .Button (sfx_tab , text = "Brawa" , command = lambda : pygame .mixer .Sound .play (bravo_sound ))
188+ button1 .pack ()
169189
170- label = tkinter .Label (sfx_tab , text = "usernane" )
171- label .pack ()
172-
173- inputUser = tkinter .Entry (sfx_tab )
174- inputUser .pack ()
190+ button2 = tkinter .Button (sfx_tab , text = "INTRO" , command = lambda : pygame .mixer .Sound .play (intro_music ))
191+ button2 .pack ()
175192
176- labelPassword = tkinter .Label (sfx_tab , text = "Password" )
177- labelPassword .pack ()
193+ button3 = tkinter .Button (sfx_tab , text = "ENDING" , command = lambda : pygame . mixer . Sound . play ( ending_music ) )
194+ button3 .pack ()
178195
179- inputPassword = tkinter .Entry (sfx_tab )
180- inputPassword .pack ()
196+ button4 = tkinter .Button (sfx_tab , text = "ROUND" , command = lambda : pygame . mixer . Sound . play ( round_sound ) )
197+ button4 .pack ()
181198
182- button = tkinter .Button (sfx_tab , text = "Go " , command = pygame .mixer .Sound . play )
183- button .pack ()
199+ button4 = tkinter .Button (sfx_tab , text = "STOP " , command = lambda : pygame .mixer .fadeout ( 500 ) )
200+ button4 .pack ()
184201
185202tabControl .add (sfx_tab , text = "SFX" )
186203tabControl .pack (expand = 1 , fill = "both" )
187204
188205
189206while True :
190207 surface .fill ((0 , 0 , 255 ))
208+
191209 # Determine responsive width and height of the rectangles
192210 if surface .get_width () < surface .get_height () * (192 / 108 ):
193211 block_width = (surface .get_width () - 125 - (28 * 2 )) / 29
0 commit comments