Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
pygame_lesson10_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
fb6beda0
authored
a year ago
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto save
parent
74c82b66
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
12 deletions
my_Tetris.py
my_Tetris.py
View file @
fb6beda0
...
...
@@ -17,7 +17,6 @@ background = pygame.image.load('bg.png')
font
=
pygame
.
font
.
Font
(
'STKAITI.TTF'
,
60
)
# 字体
center
=
[
2
,
8
]
b
=
[(
0
,
-
1
),(
0
,
0
),(
0
,
1
),(
-
1
,
0
)]
while
True
:
for
event
in
pygame
.
event
.
get
():
...
...
@@ -37,16 +36,9 @@ while True:
# 将背景图画上去
a
=
font
.
render
(
"0"
,
True
,(
0
,
0
,
0
))
screen
.
blit
(
background
,(
0
,
0
))
screen
.
blit
(
a
,(
360
,
80
))
c
=
[]
for
i
in
b
:
d
=
(
i
[
0
]
+
center
[
0
],
i
[
1
]
+
center
[
1
])
c
.
append
(
d
)
for
i
in
c
:
pygame
.
draw
.
rect
(
screen
,(
225
,
0
,
0
),(
i
[
1
]
*
20
-
20
,
i
[
0
]
*
20
-
20
,
20
,
20
),
0
)
pygame
.
draw
.
rect
(
screen
,(
225
,
225
,
225
),(
i
[
1
]
*
20
-
20
,
i
[
0
]
*
20
-
20
,
20
,
20
),
1
)
screen
.
blit
(
a
,(
360
,
80
))
pygame
.
draw
.
rect
(
screen
,(
225
,
0
,
0
),(
center
[
1
]
*
20
-
20
,
center
[
0
]
*
20
-
20
,
20
,
20
),
0
)
pygame
.
draw
.
rect
(
screen
,(
225
,
225
,
225
),(
center
[
1
]
*
20
-
20
,
center
[
0
]
*
20
-
20
,
20
,
20
),
1
)
# 刷新画面
pygame
.
display
.
update
()
clock
.
tick
(
30
)
clock
.
tick
(
FPS
)
This diff is collapsed.
Click to expand it.
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