Commit d4bc267a by BellCodeEditor

auto save

parent c6188a1e
Showing with 33 additions and 5 deletions
import pygame
# 初始化pygame,为使用pygame做准备
from pygame import locals
#初始化pygame
pygame.init()
x,y=240,120
#载入图片
blackground=pygame.image.load('bg.png')
food=pygame.image.load('apple.png')
down=pygame.image.load('down.png')
up=pygame.image.load('up.png')
body=pygame.image.load('body.png')
#创建窗口
screen=pygame.display.set_mode((690,510))
# 创建一个窗口
??
\ No newline at end of file
while True:
for event in pygame.event.get():
if event.type==locals.QUIT:
#接收退出信息
exit()
screen=pygame.display.set_mode((690,510))
#添加背景
screen.blit(blackground,(0,0))
#画果实
screen.blit(food,(360,360))
#画头
screen.blit(down,(270,120))
#画身体
screen.blit(body,(240,120))
screen.blit(down,(x,y))
x+=30
y+=30
x-=30
y-=30
#刷新画面
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