Commit 620fefa0 by BellCodeEditor

auto save

parent f36392f6
Showing with 0 additions and 29 deletions
import pygame
from pygame import locals
#初始化
pygame.init()
#建立一个窗口
screen = pygame.display.set_mode((660,480))
#载入图片
background = pygame.image.load('bg.png')
right = pygame.image.load('right.png')
food = pygame.image.load('apple.png')
body = pygame.image.load('body.png')
#让窗口一直显示,
while True:
#一直检测事件发生
for event in pygame.event.get():
#接受退出事件执行退出程序
if event.type == locals.QUIT:
exit()
#画面绘制
screen.blit(background,(0,0))
screen.blit(right,(240,180))
screen.blit(food,(390,0))
#连续调用一个文件,
screen.blit(body,(210,180))
screen.blit(body,(180,180))
screen.blit(body,(150,180))
#画面刷新
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