Commit 98fddf4a by BellCodeEditor

save project

parent 0d59b98d
Showing with 17 additions and 2 deletions
import pygame
from pygame import locals
pygame.init()
screen = pygame.display.set_mode((420,540))
music1 = pygame.mixer.Sound("歌曲1.wav")
music2 = pygame.mixer.Sound("歌曲2.wav")
music1.play()
music2.play()
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
exit()
\ No newline at end of file
...@@ -5,7 +5,6 @@ import os ...@@ -5,7 +5,6 @@ import os
pygame.init() # 初始化 pygame.init() # 初始化
# 创建窗口 # 创建窗口
screen = pygame.display.set_mode((640, 480)) screen = pygame.display.set_mode((640, 480))
# 载入图片、资源 # 载入图片、资源
bg_img = pygame.image.load('background.png') # 背景图 bg_img = pygame.image.load('background.png') # 背景图
play_img = pygame.image.load('play.png') # 播放按钮 play_img = pygame.image.load('play.png') # 播放按钮
...@@ -26,7 +25,7 @@ pygame.mixer.music.set_volume(volume) # 初始播放音量 ...@@ -26,7 +25,7 @@ pygame.mixer.music.set_volume(volume) # 初始播放音量
click = 0 click = 0
play_button = stop_img play_button = stop_img
angle = 0 angle = 0
music.play
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:
...@@ -91,6 +90,7 @@ while True: ...@@ -91,6 +90,7 @@ while True:
play_m = play_time//60 play_m = play_time//60
play_s = play_time % 60 play_s = play_time % 60
if p
info = str(play_m) + ":" + str(play_s) info = str(play_m) + ":" + str(play_s)
new_logo = pygame.transform.rotate(logo_img,angle) new_logo = pygame.transform.rotate(logo_img,angle)
......
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