Commit 986fb757 by BellCodeEditor

save project

parent d9e71c31
Showing with 3 additions and 3 deletions
import pygame
from pygame import locals
import random
pygame.init() # 初始化
score = 0
grid_size = 20 # 格子大小
......@@ -54,7 +54,7 @@ def check(center):
for cube in current_shape:
cube =(cube[0]+center[0],cube[1]+center[1])
if cube[0] < 1 or cube[1] < 1 or cube[0] > grid_num_height \
or cube[1] >grid_unm_width:
or cube[1] >grid_num_width:
return False
while True:
for event in pygame.event.get():
......@@ -62,7 +62,7 @@ while True:
exit()
if event.type == locals.KEYDOWN:
if event.key == locals.K_LEFT: # 向右
center[1] = cebter[1] - 1
center[1] = center[1] - 1
for cube in current_pos:
if cube[1] <= 1:
center[1] = center[1] + 1
......
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