Commit a6789c03 by BellCodeEditor

save project

parent c6188a1e
Showing with 175 additions and 3 deletions
File added
import pygame
from pygame import locals
pygame.init() # 初始化
score = 0
grid_size = 20 # 格子大小
grid_num_width = 15 # 横向格子数量
grid_num_height = 25 # 纵向格子数量
FPS = 30
# 创建窗口
screen = pygame.display.set_mode((460, 500))
pygame.display.set_caption("俄罗斯方块")
clock = pygame.time.Clock() # pygame时钟,控制游戏速度(帧数)
# 载入素材
background = pygame.image.load('bg.png')
font = pygame.font.Font('STKAITI.TTF', 60) # 字体
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
exit()
# 将背景图画上去
???
# 得分
???
# 刷新画面
pygame.display.update()
clock.tick(FPS)
#导入pygame
import pygame
from pygame import locals
# 初始化pygame,为使用pygame做准备
pygame.init()
# 创建一个窗口
??
\ No newline at end of file
screen = pygame.display.set_mode((660,480))
FPS = pygame.time.Clock()
background = pygame.image.load('bg.png')
right = pygame.image.load('right.png')
food = pygame.image.load('apple.png')
body = pygame.image.load('body.png')
x,y = 240,120
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
exit()
x+=30
screen.blit(background,(0,0))
screen.blit(right,(x,y))
screen.blit(body,(210,120))
screen.blit(body,(180,90))
screen.blit(body,(180,120))
screen.blit(food,(360,300))
FPS.tick(3)
pygame.display.update()
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