Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

Administrator / pygame_lesson5_diy1

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Commit bc21d2e8 authored 9 months ago by BellCodeEditor's avatar BellCodeEditor
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

save project

parent a6031dec
Show whitespace changes
Inline Side-by-side
Showing with 7 additions and 2 deletions
  • my_music.py
my_music.py
View file @ bc21d2e8
import pygame import pygame
from pygame import locals from pygame import locals
import os
pygame.init() # 初始化 pygame.init() # 初始化
# 创建窗口 # 创建窗口
screen = pygame.display.set_mode((640, 480)) screen = pygame.display.set_mode((640, 480))
...@@ -19,7 +19,12 @@ volume = 0.2 ...@@ -19,7 +19,12 @@ volume = 0.2
pygame.mixer.music.set_volume(volume) # 初始播放音量 pygame.mixer.music.set_volume(volume) # 初始播放音量
click = 0 click = 0
play_button = stop_img play_button = stop_img
music_list = []
path = "C:\\Users\\Administrator\\Desktop\\test"
filelist = os.listdir(path)
for i in filelist:
if i[-4:] == ".wav" or i[-4:] == ".ogg"
music_list.append(i)
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:
......
This diff is collapsed. Click to expand it.
  • Write
  • Preview
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