Skip to content

Commit 911ffa0

Browse files
authored
Merge pull request #38 from xKRISTOFx/main2
For deepsource to run checks of code quality
2 parents fe80275 + 324b5e7 commit 911ffa0

4 files changed

Lines changed: 39 additions & 22 deletions

File tree

blackboard.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
dubel_sound = pygame.mixer.Sound("sfx/dubel.wav")
1111
bravo_sound = pygame.mixer.Sound("sfx/bravo.wav")
1212
write_sound = pygame.mixer.Sound("sfx/write.wav")
13+
round_sound = pygame.mixer.Sound("sfx/round_sound.wav")
1314
ending_music = pygame.mixer.Sound("sfx/final_ending.flac")
1415
intro_music = pygame.mixer.Sound("sfx/show_music.flac")
1516

@@ -121,14 +122,12 @@ def round_init(self, round_number):
121122
# Set the answers as not printed
122123
for answer_dict in self.answers[round_number]:
123124
answer_dict[2] = False
125+
# Play round SFX
126+
pygame.mixer.Sound.play(round_sound)
124127

125128
# Print selected answer for selected round
126129
def show_answer(self, round_number, answer_number):
127130

128-
# Check if a team has been selected
129-
if self.faster_team == "":
130-
return
131-
132131
# Check if the answer is already printed
133132
if self.answers[round_number][answer_number][2]:
134133
return

dane.csv

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
te,75,tre,54,dsf,42,er,33,tred,5,fds,5,ewae,3
2-
qvdef,95,tre,54,dsf,42,er,33,fds,5,ewae,3
1+
mabel pines,75,stanford pines,54,bill cypher,42,pacifica,33,mcgucket,5,giddeon,5
2+
qvdef,95,tre,54,dsf,42,er,33,ewawe,33,fds,5
33
dsf,42,tg,5,fds,3,ewq,2
4-
rtew,75,iuhsthijorj,3
4+
kujjru,93,rtew,75,iuhsthijorj,63,tre,54,piter4,53,dsf,42,er,33
55
rweewr,53

familiada.py

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import os
55
from tkinter import messagebox, ttk, filedialog
66
from 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):
111112
style = ttk.Style(window1)
112113
window1.protocol("WM_DELETE_WINDOW", lambda: exit_app(window1))
113114

114-
#Create tab controler in the window1
115+
# Create tab controler in the window1
115116
tabControl = 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
147148
score_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+
164182
tabControl.add(final_tab, text="Finał")
165183

166184
# Create SFX tab
167185
sfx_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

185202
tabControl.add(sfx_tab, text="SFX")
186203
tabControl.pack(expand=1, fill="both")
187204

188205

189206
while 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

sfx/round_sound.wav

1.85 MB
Binary file not shown.

0 commit comments

Comments
 (0)