Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
pygame_lesson12_diy3
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
03175c96
authored
Jul 08, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
d96f7abe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletions
my_Tetris.py
my_Tetris.py
View file @
03175c96
...
@@ -18,7 +18,8 @@ pygame.display.set_caption("俄罗斯方块")
...
@@ -18,7 +18,8 @@ pygame.display.set_caption("俄罗斯方块")
clock
=
pygame
.
time
.
Clock
()
# pygame时钟,控制游戏速度(帧数)
clock
=
pygame
.
time
.
Clock
()
# pygame时钟,控制游戏速度(帧数)
# 载入素材
# 载入素材
background
=
pygame
.
image
.
load
(
'bg.png'
)
background
=
pygame
.
image
.
load
(
'bg.png'
)
font
=
pygame
.
font
.
Font
(
'STKAITI.TTF'
,
60
)
# 字体
font1
=
pygame
.
font
.
Font
(
'STKAITI.TTF'
,
60
)
# 字体
font2
=
pygame
.
font
.
Font
(
'STKAITI.TTF'
,
30
)
# 俄罗斯方块所有形状
# 俄罗斯方块所有形状
O
=
[[(
0
,
0
),
(
0
,
1
),
(
1
,
0
),
(
1
,
1
)]]
O
=
[[(
0
,
0
),
(
0
,
1
),
(
1
,
0
),
(
1
,
1
)]]
I
=
[[(
0
,
-
1
),
(
0
,
0
),
(
0
,
1
),
(
0
,
2
)],
I
=
[[(
0
,
-
1
),
(
0
,
0
),
(
0
,
1
),
(
0
,
2
)],
...
@@ -130,6 +131,10 @@ while True:
...
@@ -130,6 +131,10 @@ while True:
else
:
else
:
score
+=
1
score
+=
1
num_list
=
new_list
num_list
=
new_list
if
num_list
[
1
][
7
]
!=
0
:
states
=
False
text_shibai
=
font1
.
render
((
"游戏结束,按任意键开始"
,
True
,(
0
,
0
,
0
))
screen
.
blit
=
htttgggfffffffffffffte
tj
3
s
,
l3s4drs78
wcygdx
v
4
c
w5
0
nw
frvb
hvfy90wasdnhf0nrqrtbvygce0
ogutfv4enrtyem
gyofsgvtrv7f9uhbfvgtvj5kdcjh
bun
lbhfriod
fvsfahjdzxm
# 得分
# 得分
text_surface
=
font
.
render
(
str
(
score
),
True
,
(
0
,
0
,
0
))
text_surface
=
font
.
render
(
str
(
score
),
True
,
(
0
,
0
,
0
))
screen
.
blit
(
text_surface
,
(
350
,
70
))
screen
.
blit
(
text_surface
,
(
350
,
70
))
...
...
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