Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
pygame_lesson11_diy4
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
018903e6
authored
Aug 13, 2021
by
BellCodeEditor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
save project
parent
064c7eed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
my_Tetris.py
my_Tetris.py
View file @
018903e6
...
@@ -62,13 +62,8 @@ def comon(center):
...
@@ -62,13 +62,8 @@ def comon(center):
return
False
return
False
states
=
True
states
=
True
while
True
:
while
True
:
if
states
==
False
:
current_shape1
=
random
.
choice
(
shape_list
)
index
=
random
.
randint
(
0
,
len
(
current_shape1
)
-
1
)
current_shape
=
current_shape1
[
index
]
color
=
random
.
choice
(
cube_colors
)
states
=
True
comon
(
center
)
comon
(
center
)
for
event
in
pygame
.
event
.
get
():
for
event
in
pygame
.
event
.
get
():
if
event
.
type
==
locals
.
QUIT
:
if
event
.
type
==
locals
.
QUIT
:
...
@@ -103,15 +98,22 @@ while True:
...
@@ -103,15 +98,22 @@ while True:
if
comon
(
center
)
==
False
:
if
comon
(
center
)
==
False
:
index
=
old_index
index
=
old_index
current_shape
=
current_shape1
[
index
]
current_shape
=
current_shape1
[
index
]
if
states
==
False
:
center
=
[
2
,
8
]
states
=
True
current_shape1
=
random
.
choice
(
shape_list
)
index
=
random
.
randint
(
0
,
len
(
current_shape1
)
-
1
)
current_shape
=
current_shape1
[
index
]
color
=
random
.
choice
(
cube_colors
)
count
+=
1
count
+=
1
if
count
%
FPS
==
0
:
if
count
%
FPS
==
0
:
if
center
[
0
]
<
25
:
center
[
0
]
=
center
[
0
]
+
1
center
[
0
]
+=
1
if
comon
(
center
)
==
False
:
if
comon
(
center
)
==
False
:
center
[
0
]
-=
1
center
[
0
]
-=
1
if
center
[
0
]
>=
grid_num_height
:
states
=
False
states
=
False
...
...
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