Commit 411411db by BellCodeEditor

save project

parent 139af502
Showing with 23 additions and 22 deletions
import pygame
from pygame import locals
import os
pygame.init() # 初始化
# 创建窗口
screen = pygame.display.set_mode((640, 480))
......@@ -20,7 +20,7 @@ for i in filelist:
music_list.append(i)
filelist =['歌曲1.wav''歌曲2.wav','歌曲3.wav','歌曲4.ogg']
#filelist =['歌曲1.wav','歌曲2.wav','歌曲3.wav','歌曲4.ogg']
num =-1
angle=0
volume=0.2
......@@ -34,39 +34,40 @@ while True:
if event.type==locals.KEYDOWN:
if event.key==locals.K_UP:
volume+=0.1
if volume>1
if volume>1:
volume=1
if event.key==locals.K_DOWN:
volume-=0.1
if volume<0
if volume<0:
volume=0
if event.type==locals.MOUSEBUTTONDOWN:
if event .button==1:
x,y = event.pos
if x >270 and x<370and y > 350 and y < 450 chick+=1
if chick%2==0:
pygame.mixer.music.unpause()
play_button=stop_img
else:
pygame.mixer.music.pause()
if event .button==1:
x,y = event.pos
if x >270 and x<370 and y>350 and y < 450:
chick+=1
if chick%2==0:
pygame.mixer.music.unpause()
play_button=stop_img
else:
pygame.mixer.music.pause()
if x >120 and x<220 and y>350
if x >120 and x<220 and y>350:
num-=1
if num<0:
num =len(music_list)-1
pygame.mixer.music.lode
play_button=play_img
num =len(music_list)-1
pygame.mixer.music.lode
play_button=play_img
if pygame.mixer.music.get_busy()==False:
num+=1
if num.len(filelist)-1
num =0
pygame.mixer.music.load(filelist[num])
pygame.mixer.music.play()
if num.len(filelist)-1:
num =0
pygame.mixer.music.load(filelist[num])
pygame.mixer.music.play()
new_logo =pygame.transform.rotate(logo_img,angle)
newRect=new_logo.get_rect(center=(320,200))
pos=(newRect[0],newRect[1])
angle+=1
if play_button==stop_img:
angle+=1
# 绘制画面
screen.blit(bg_img, (0, 0)) # 填充背景
screen.blit(stop_img, (270, 330)) # 暂停按钮
......
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