Commit 4f462495 by BellCodeEditor

auto save

parent f1355490
Showing with 4 additions and 0 deletions
import pygame import pygame
from pygame import locals from pygame import locals
import random
pygame.init() # 初始化 pygame.init() # 初始化
score = 0 score = 0
...@@ -9,6 +10,7 @@ grid_num_height = 25 # 纵向格子数量 ...@@ -9,6 +10,7 @@ grid_num_height = 25 # 纵向格子数量
FPS = 30 FPS = 30
center=[2,8] center=[2,8]
sb=[(0,1),(0,0),(0,-1),(-1,0)] sb=[(0,1),(0,0),(0,-1),(-1,0)]
E=0
# 创建窗口 # 创建窗口
screen = pygame.display.set_mode((460, 500)) screen = pygame.display.set_mode((460, 500))
pygame.display.set_caption("俄罗斯方块") pygame.display.set_caption("俄罗斯方块")
...@@ -29,6 +31,8 @@ while True: ...@@ -29,6 +31,8 @@ while True:
center[1]-=1 center[1]-=1
elif event.key == locals.K_DOWN and center[0]<25: elif event.key == locals.K_DOWN and center[0]<25:
center[0]+=1 center[0]+=1
b=[]
for cube in a:
SB=[] SB=[]
for cube in sb: for cube in sb:
s=(cube[0]+center[0],cube[1]+center[1]) s=(cube[0]+center[0],cube[1]+center[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