Commit ec5633db by BellCodeEditor

save project

parent 6b2b7827
Showing with 11 additions and 0 deletions
......@@ -3,6 +3,7 @@ from pygame import locals
pygame.init() # 初始化
score = 0
center=[2,8]
grid_size = 20 # 格子大小
grid_num_width = 15 # 横向格子数量
grid_num_height = 25 # 纵向格子数量
......@@ -20,6 +21,16 @@ while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
exit()
if event.type==locals.KEYDOWN:
if event.type==locals.K_RIGHT:
if center[1]<15:
center[1]+=1
elif event.type==locals.K_LEFT:
if center[1]>1:
center[1]-=1
elif event.type==locals.K_DOWN:
if center[0]<25:
center[0]+=0
# 将背景图画上去
screen.blit(background,,(0,0))
......
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