Commit 007c9880 by BellCodeEditor

auto save

parent 71230f47
Showing with 23 additions and 6 deletions
import pygame
from pygame import locals
# 初始化pygame,为使用pygame做准备
pygame.init()
# 初始化pygame,为使用硬件做准备
pygame.init()
# 创建一个窗口
??
\ No newline at end of file
# 创建一个窗口
screen = pygame.display.set_mode((660, 480))
# 图片素材
background = pygame.image.load('bg.png')
food = pygame.image.load('apple.png')
while True:
for event in pygame.even if event.type == locals.QUIT:
17 # 接收到退出事件后退出程序
18 exit()
19 # 将背景图画上去
20 screen.blit(background, (0, 0))
21 # 将果实画上去
22 screen.blit(food, (0, 0))
23 screen.blit(food, (0, 450))
24 screen.blit(food, (630, 0))
25 screen.blit(food, (630, 450))
26 # 刷新画面
27 pygame.display.update()
\ No newline at end of file
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