Commit 61ea805f by BellCodeEditor

save project

parent 290e6841
Showing with 37 additions and 4 deletions
...@@ -10,10 +10,44 @@ play = pygame.image.load("play.png") ...@@ -10,10 +10,44 @@ play = pygame.image.load("play.png")
stop = pygame.image.load("stop.png") stop = pygame.image.load("stop.png")
font = pygame.font.Font("neuropol.ttf",20) font = pygame.font.Font("neuropol.ttf",20)
fps = pygame.time.Clock() fps = pygame.time.Clock()
pygame.mixer.music.load("test.wav")
volume = 0.2
click = 0
pygame.mixer.music.set_volume(volume)
play_button = stop
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
exit() exit()
screen.blit(backgroud,(0,0)) if event.type == locals.MOUSEBUTTONDOWN:
pygame.display.undate() if event.button == 1:
fps.tick(30) x,y = event.pos
\ No newline at end of file if x < 270 and x < 330 and y < 430 and y > 330:
if click == 0:
click = 1
play_button = play
pygame. mixer.music.pause()
else:
click = 0
play_button = stop
pygame.mixer.music.unpause()
if event.type == locals.KEYDOWN:
if event.key == locals.K_UP:
volume += 0.1
if volume > 1:
volume = 1
pygame.mixer.music.set_volume(volume)
if event.key == locals.K_DOWN:
volume -= 0.1
if volume < 0:
volume = 0
pygame.mixer.music.set_volume(volume)
if pygame.mixer.music.get_busy() == False:
pygame.mixer.music.play()
screen.blit(background,(0,0))
screen.blit(logo,(170,60))
screen.blit(play_button,(270,330))
screen.blit(last,(120,350))
screen.blit(next,(420,350))
pygame.display.update()
fps.tick(30)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment