Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
pygame_lesson5_diy1
This project
Loading...
Sign in
Toggle navigation
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
b26b526d
authored
Jan 15, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
015580cf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
186 additions
and
1 deletions
com.py
my_music.py
com.py
0 → 100644
View file @
b26b526d
#正八边形
# import turtle
# pen = turtle.Pen()
# pen.fillcolor("red")
# pen.begin_fill()
# for i in range(8):
# pen.forward(20)
# pen.left(45)
# pen.end_fill()
# pen.hideturtle()
# turtle.done()
#diy1
# import turtle
# pen = turtle.Pen()
# pen.fillcolor("red")
# pen.begin_fill()
# for i in range(6):
# pen.forward(30)
# pen.left(60)
# pen.forward(30)
# pen.right(120)
# pen.end_fill()
# pen.hideturtle()
# turtle.done()
#四分之三圆
# import turtle
# pen = turtle.Pen()
# pen.pencolor("red")
# pen.pensize(7)
# pen.circle(100,270)
# pen.left(90)
# pen.forward(100)
# pen.right(90)
# pen.forward(100)
# pen.hideturtle()
# turtle.done()
# import turtle
# pen = turtle.Pen()
# pen.circle(50)
# pen.penup()
# pen
# pen.hideturtle()
# turtle.done()
import
turtle
as
t
t
.
speed
(
0.1
)
t
.
setup
(
800
,
600
)
#设置窗口宽度和高度
t
.
pensize
(
3
)
t
.
penup
()
t
.
goto
(
150
,
100
)
t
.
pendown
()
#机器猫的脸
t
.
seth
(
90
)
#改变执行方向
t
.
circle
(
150
,
-
30
)
t
.
circle
(
150
,
240
)
t
.
left
(
90
)
t
.
penup
()
t
.
fd
(
7
)
t
.
seth
(
-
70
)
t
.
pendown
()
t
.
circle
(
130
,
-
77
)
t
.
penup
()
t
.
circle
(
130
,
-
67
)
t
.
pendown
()
t
.
circle
(
130
,
-
77
)
t
.
penup
()
t
.
seth
(
180
)
t
.
goto
(
40
,
215
)
t
.
seth
(
170
)
t
.
pendown
()
t
.
circle
(
30
,
360
)
t
.
seth
(
180
)
t
.
penup
()
t
.
fd
(
75
)
# t.pendown()
# t.circle(30,360)
# t.penup()
# t.goto(0,130)
# t.pendown()
# t.circle(10,360)
# t.seth(-90)
# t.penup()
# t.fd(20)
# t.pendown()
# t.fd(75)
# t.penup()
# t.goto(-80,100)
# t.pendown()
# t.circle(80,180)
# t.penup()
# t.goto(40,100)
# t.right(60)
# t.pendown()
# t.fd(100)
# t.penup()
# t.goto(40,90)
# t.seth(0)
# t.pendown()
# t.fd(100)
# t.penup()
# t.goto(40,80)
# t.right(30)
# t.pendown()
# t.fd(100)
# t.penup()
# t.goto(-40,100)
# t.right(180)
# t.pendown()
# t.fd(100)
# t.penup()
# t.goto(-40,90)
# t.seth(180)
# t.pendown()
# t.fd(100)
# t.penup()
# t.goto(-40,80)
# t.seth(210)
# t.pendown()
# t.fd(100)
# t.circle(30,360)
# t.penup()
# t.goto(100,30)
# t.pendown()
# t.circle(30,360)
# t.penup()
# t.goto(-140,20)
# t.pendown()
# t.left(10)
# t.circle(150,30)
# t.circle(30,180)
# t.right(22)
# t.circle(160,19)
# t.penup()
# t.goto(140,20)
# t.pendown()
# t.seth(-45)
# t.circle(-150,30)
# t.circle(-30,180)
# t.right(-17)
# t.circle(-160,17)
# t.penup()
# t.goto(-160,-83)
# t.seth(0)
# t.pendown()
# t.circle(-50,360)
# t.penup()
# t.goto(160,-83)
# t.pendown()
# t.circle(-50,360)
# t.penup()
# t.goto(-115,-163)
# t.pendown()
# t.seth(10)
# t.circle(-600,23)
# t.penup()
# t.goto(-82,-13)
# t.pendown()
# t.right(5)
# t.circle(270,37)
# t.penup()
# t.goto(-82,12)
# t.pendown()
# t.seth(16)
# t.circle(-270,37)
# t.penup()
# t.goto(-50,-60)
# t.seth(0)
# t.pendown()
# t.fd(100)
# t.seth(-90)
# t.circle(-50,180)
t
.
done
()
my_music.py
View file @
b26b526d
...
@@ -18,6 +18,7 @@ logo_img = pygame.image.load('logo.png') # 下一曲按钮
...
@@ -18,6 +18,7 @@ logo_img = pygame.image.load('logo.png') # 下一曲按钮
# 载入音乐
# 载入音乐
#pygame.mixer.music.load('歌曲4.ogg') # 载入音乐
#pygame.mixer.music.load('歌曲4.ogg') # 载入音乐
#my_songlist = ['歌曲1.wav','歌曲2.wav','歌曲3.wav','歌曲4.ogg']
#my_songlist = ['歌曲1.wav','歌曲2.wav','歌曲3.wav','歌曲4.ogg']
num
=-
1
my_songlist
=
[]
my_songlist
=
[]
path
=
'C:
\\
Users
\\
tang
\\
Desktop
\\
test'
path
=
'C:
\\
Users
\\
tang
\\
Desktop
\\
test'
#path = 'C:\Users\tang\Desktop\test'
#path = 'C:\Users\tang\Desktop\test'
...
@@ -27,7 +28,7 @@ for i in flist:
...
@@ -27,7 +28,7 @@ for i in flist:
my_songlist
.
append
(
i
)
my_songlist
.
append
(
i
)
num
=-
1
volume
=
0.2
volume
=
0.2
pygame
.
mixer
.
music
.
set_volume
(
volume
)
# 初始播放音量
pygame
.
mixer
.
music
.
set_volume
(
volume
)
# 初始播放音量
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment