Commit efd0fe13 by BellCodeEditor

auto save

parent c6188a1e
Showing with 19 additions and 4 deletions
import pygame
from pygame import locals
# 初始化pygame,为使用pygame做准备
pygame.init()
# 创建一个窗口
??
\ No newline at end of file
right = pygame.image.load('right.png')#导入图片
food = pygame.image.load('apple.png')
backgound = pygame.image.load('bg.png')
body = pygame.image.load('body.png')
screen = pygame.display.set_mode((800,600))#设置窗口大小
while True:
for event in pygame.event.get():#遍历时间
print(event)
if event.type == locals.MOUSEBUTTONDOWN:#如果事件结果等于 鼠标按下
exit()
screen.blit(backgound,(0,0))#设置图片
screen.blit(food,(60,60))
screen.blit(right,(120,90))
screen.blit(body,(90,90))
screen.blit(body,(60,90))
screen.blit(body,(30,90))
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