while active: #while playing
current_time = pygame.mixer.music.get_pos()
window.fill((0,0,0))
#drawing buttons
if is_paused:
cont_button.draw(window)
else:
pause_button.draw(window)
bw_button.draw(window)
fw_button.draw(window)
for event in pygame.event.get():
if event.type == pygame.QUIT:
active = False
if event.type == pygame.MOUSEBUTTONUP: #not gonna lie im kind of brain dead from when i was on this, so try reviewing what i did
if pause_button.is_pressed(event):
pygame.mixer_music.pause()
is_paused = True
cont_button.changePos((650,100))
pause_button.changePos((1000,800))
elif cont_button.is_pressed(event):
pygame.mixer_music.unpause()
is_paused = False
cont_button.changePos((1000,800))
pause_button.changePos((650,100))
if fw_button.is_pressed(event): #skip button
if current_time + 5000 > aud.duration :
pygame.mixer.music.rewind() #reloop yaheard
current_time = 0
else:
current_time = (current_time + 5000)/1000
pygame.mixer.music.set_pos(current_time)
pygame.time.delay(500)
if bw_button.is_pressed(event): #rewind button
if current_time - 5000 <= 0:
pygame.mixer.music.rewind()
current_time = 0
else:
current_time = (current_time - 5000)/1000
pygame.mixer.music.set_pos(current_time)
pygame.time.delay(500)
current_sec = current_time/1000
My main concern is regarding the bw_button.is_pressed(event): section,, It wont rewind how I want it to rewind