Skip to content

Commit 7c86c24

Browse files
Song title color changed while playing song
1 parent 9532dd5 commit 7c86c24

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

game.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ def calc_song_progress_percent(song_length,song_start_time,current_time): # ret
118118

119119

120120
def run_FGHJ(screen,clock,song_name,stage_speed,offset,judgement_shown,guide_line_shown):
121+
global bar_color
121122
game_run = True
122123
score = [0]
123124
chart_info = get_chart(song_name)
@@ -137,7 +138,7 @@ def run_FGHJ(screen,clock,song_name,stage_speed,offset,judgement_shown,guide_lin
137138
verifier = Verifier(screen,score,stage_speed,judgement_shown,song_bpm)
138139

139140

140-
bar_color = (90,90,90)
141+
141142
bar_pos = (width // 2, info_length//4)
142143
song_progress = 0
143144

@@ -235,9 +236,9 @@ def run_FGHJ(screen,clock,song_name,stage_speed,offset,judgement_shown,guide_lin
235236
# 4. song progress를 표시한다(진행상황)
236237
current_time = pygame.time.get_ticks() # in milliseconds
237238
song_progress = calc_song_progress_percent(song_length, song_start_time, current_time)
238-
draw_progress_bar(screen, song_progress, bar_color, bar_pos[0], bar_pos[1])
239+
draw_progress_bar(screen, song_progress, bar_pos[0], bar_pos[1])
239240

240-
write_text(screen, width//2, (info_length//2)//2, 'Song: %s'%(song_name), small_text, background_color[0], highlight_text_color)
241+
write_text(screen, width//2, (info_length//2)//2, 'Song: %s'%(song_name), small_text, bar_color, highlight_text_color)
241242
write_text(screen, width // 2, (info_length // 2) // 2 + (info_length // 2), 'Score: %.2f' % score[0], small_text, background_color[0],
242243
highlight_text_color)
243244

@@ -256,12 +257,13 @@ def run_FGHJ(screen,clock,song_name,stage_speed,offset,judgement_shown,guide_lin
256257
break
257258

258259

259-
def draw_progress_bar(screen, song_progress, color,x,y):
260+
def draw_progress_bar(screen, song_progress, x,y):
261+
global bar_color
260262
bar_width = width
261263
bar_height = info_length//2
262264

263265
#draw_bar_frame(screen, x, y, bar_width, bar_height, color) # don't need frames here
264-
draw_bar(screen,x,y,bar_width,bar_height, song_progress, color)
266+
draw_bar(screen,x,y,bar_width,bar_height, song_progress, bar_color)
265267

266268

267269
def draw_frame(screen):

variables.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ def make_color_lighter(color):
7575
dark_text_color = (default_text_color[0]//2+10, default_text_color[1]//2+50, default_text_color[2]//2+50)
7676
highlight_text_color = (200,230,255)
7777
red_highlight_text_color = (240, 180, 180)
78+
bar_color = (90,90,90)
79+
7880

7981
frame_alpha_max = 100
8082
frame_alpha = 0

0 commit comments

Comments
 (0)