Commit 9102993f by BellCodeEditor

save project

parent 349f0c91
Showing with 186 additions and 5 deletions
import pygame
from pygame import locals
pygame.init()
score=0
grid_size=0
grid_num_width=15
grid_num_height=25
FPS=30
screen=pygame.display.set_mode((460,500))
pygame.display.set_caption('老师万岁')
clock=pygame.time..Clock()
background=pygame.image.load()
font = pygame.font.Font('STKAII.TTF',60)
while True:
for event in pygame.event.get():
if event.type==locals.QUIT:
exit()
screen.blit(background,(0,0))
score_text=font.render(str(score),True,(0,0,0))
screen.blit(score_text,(350,70))
pygame.display.urgent()
clock.tick(FPS)
s=s
print(s)
\ No newline at end of file
......@@ -14,7 +14,7 @@ next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 下一曲按钮
music_list = []
path = "C:\\Users\\Administrator\\Desktop\\tast"
path = os.path.join("C:\\Users\\777\\Desktop\\mi")
filelist = os.listdir(path)
num = -1
for i in filelist:
......@@ -81,9 +81,11 @@ while True:
num += 1
if num > len(music_list)-1:
num = 0
pygame.mixer.music.load(path + "\\" + music_list[num])
pygame.mixer.music.load(os.path.join(path,music_list[num]))
pygame.mixer.music.play()
new_logo = pygame.transform.rotate(logo_img, angle)
new_logo = pygame.transform.notate(logo_img,angle)
newRect = new_logo.get_rect(center=(320,200))
pos = (newRect[0],newRect[1])
angle += 1
screen.blit(bg_img, (0, 0))
screen.blit(play_button, (270, 330))
......@@ -91,4 +93,5 @@ while True:
screen.blit(last_img, (120, 350))
screen.blit(next_img, (420, 350))
pygame.display.update()
\ No newline at end of file
pygame.display.update()
FPS.tick(60)
\ No newline at end of file
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