Commit 434d1484 by BellCodeEditor

save project

parent fda3e74f
Showing with 13 additions and 0 deletions
...@@ -51,6 +51,17 @@ shape =random.choice(shape_list) ...@@ -51,6 +51,17 @@ shape =random.choice(shape_list)
index = random.randint(0,len(shape)-1) index = random.randint(0,len(shape)-1)
current_shape = shape[index] current_shape = shape[index]
color = random.choice(cube_colors) color = random.choice(cube_colors)
count += 1
if count % FPS == 0:
center[0] = center[0] + 1
if check(center) == False:
center[0] = center[0] - 1
states = False
for cube in current_pos:
num_list[cube[0]-1][cube[1]-1] = color
num_list = []
for i in range(25):
num_list.append([0]*15)
def check(center): def check(center):
for cube in current_shape: for cube in current_shape:
...@@ -58,6 +69,8 @@ def check(center): ...@@ -58,6 +69,8 @@ def check(center):
if cube[0] < 1 or cube[1] < 1 or cube[0] > grid_num_height \ if cube[0] < 1 or cube[1] < 1 or cube[0] > grid_num_height \
or cube[1] >grid_num_width: or cube[1] >grid_num_width:
return False return False
if num_list[cube[0]-1][cube[1]-1] != 0:
return False
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
......
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