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

Administrator / pygame_lesson11_diy4

  • 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 018903e6 authored 3 years ago by BellCodeEditor's avatar BellCodeEditor
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

save project

parent 064c7eed
Hide whitespace changes
Inline Side-by-side
Showing with 14 additions and 12 deletions
  • my_Tetris.py
my_Tetris.py
View file @ 018903e6
......@@ -62,13 +62,8 @@ def comon(center):
return False
states=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)
for event in pygame.event.get():
if event.type == locals.QUIT:
......@@ -103,15 +98,22 @@ while True:
if comon(center)==False:
index=old_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
if count%FPS==0:
if center[0] < 25:
center[0] += 1
if comon(center)==False:
center[0]= center[0]+1
if comon(center)==False:
center[0]-=1
if center[0]>=grid_num_height:
states=False
states=False
......
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