Commit 4821f494 by BellCodeEditor

auto save

parent 5200fee2
Showing with 11 additions and 4 deletions
...@@ -15,17 +15,24 @@ clock = pygame.time.Clock() # pygame时钟,控制游戏速度(帧数) ...@@ -15,17 +15,24 @@ clock = pygame.time.Clock() # pygame时钟,控制游戏速度(帧数)
# 载入素材 # 载入素材
background = pygame.image.load('bg.png') background = pygame.image.load('bg.png')
zhu_ = pygame.font.Font('STKAITI.TTF', 60) # 字体 zhu_ = pygame.font.Font('STKAITI.TTF', 60) # 字体
x=140
y=0
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
exit() exit()
if if event.key == locals.K_a:
x-=20
if event.key == locals.K_d:
if event.key == locals.K_d:
# 将背景图画上去 if event.key == locals.K_d:
screen.blit(background,(0,0)) screen.blit(background,(0,0))
zhu=zhu_.render(str(zhu0),True,(0,0,0)) zhu=zhu_.render(str(zhu0),True,(0,0,0))
screen.blit(zhu,(400,50)) screen.blit(zhu,(400,50))
# 刷新画面 pygame.draw.rect(screen,(0,0,0),(x,y,20,20))
pygame.display.update() pygame.display.update()
clock.tick(FPS) clock.tick(FPS)
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