Commit 0cc63833 by BellCodeEditor

auto save

parent 821a6939
Showing with 12 additions and 2 deletions
import pygame
from pygame import locals
#初始化pygame,为使用硬件做准备
pygame.init()
#载入图片
bg = pygame.image.load('bg.png')#背景图片
right = pygame.image.load('right.png')
apple = pygame.image.load('apple.png')
screen = pygame.display.set_mode((640,480))
screen = pygame.display.set_mode((660,480))
while True:
for event in pygame.event.get():
print(event)
if event.type == locals.QUIT:
#接收到程序后退出事件
exit()
#将背景图片画上去
screen.blit(bg,(0,0))
#刷新画面
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